Record input parameter and local variable record dropping values

Record input parameter and local variable record dropping values

  
This is a strange behaviour that we uncovered while a new developer was going through the training material.
 
It is not recommended practice to pass records to a web screen which is what junior was attempting to do and in the process arrived at a pattern that used a screen action to pass the record to the web screen.
 
The passed parameter is then used to populate some expressions on the web screen. To troubleshoot the behaviour, the input parameter was mapped to an internal variable.
 
When the preparation breakpoint is hit during debug, the parameter and the variable both contain values. The expressions on the web screen get populated and everything looks good.
 
When calling a screen action from a button and the breakpoint is reached, the variable is empty and the parameter only has the values that were in the expressions on the web screen.
 
Is there a logical explanation for this behaviour or is it a bug?
 
Attached is the OML for reference.
 
Thanks
?Ouen
I also had the same problem and then i change my implimentation. But this still is my question.
Solution
Hi,

That description sounds like Optimizer related. When calling a screen action the debugger won't be able to see variables that are never read (because the optimizer determines that they are never needed so they are not presisted between calls)

Was this actually causing a problem or only "could not see the values while debugging"?

Regards,
João Rosado
Solution
For osme reason if i want to save that record i didnt get the values to save in the record in screen action.
I have confirmed that it is just a quirk in the Studio debugger as highlighted by João.

Attached is an updated example where the input parameter is returned to the calling webscreen as a string and all the data is present in the returned string.

Thanks
Ouen