BUG? Forms - strange behaviour when assigning variable value via Screen action.

BUG? Forms - strange behaviour when assigning variable value via Screen action.

1) Create a form, with source "MySource"
2) Add a screen action MyAction, (this screen action assigns a value to MyForm.Record.SomeField)
3) Add a hyperlink and attach it to MyAction, (make sure to change the submit method to AJAX Submit).
4) Add a submit button with submit method Ajax Submit.
5) Publish the eSpace, input some value into any text field, click on the hyperlink (created in step 3)
6) Click the submit button.

You would expect all inputs (user input and action assigned input) to get assigned to MySourceForm.Record, 
it doesn't, only the user input is assigned! 

Note: There is a refresh widget in the submit button flow, it refreshes the form when an error occurs, it refreshes the entire form, and only keeps the values assigned by the user, the value assigned by the screen action in step 3 is removed.  This behaviour does not seem to be a normal behaviour with AJAX submit method.

If you want to keep all inputs the values assigned by the user and the value assigned by a screen action, you will have to assign the value to the source record "MySource". Since outsystems removes values assigned by screen action! 
eSpace please?

You can reproduce this issue via the attached eSpace.

(Remember to remove IPP)
Hi Robert,

I'm not entirely sure what you mean (and the eSpace is still in Processing Upload), but an EditRecord (and perhaps also the new Form) has a local copy of the data structure (as opposed to a TableRecords), which is refreshed on an Ajax Refresh. What you need to do is first assign the EditRecord contents back to its source, make the changes in the source, and Ajax Refresh the widget. (Note this is all from memory, and it's a while back that I needed this - please correct me anyone if I'm wrong.)

Tha is correct, when the Ajax refresh the source record variable too?  and this is the problem, this behaviour is undocumented, any undocumented behaviour that differs from standard programming behaviour are considered bugs.

Let me explain, when you build this same application in either ASP.NET or JSP and you do an Ajax refresh, it will only refresh the part of the screen and not the whole screen, variables you use in page_load or on_load event are only executed once on load.

I believe outsystems form source record is intended it to work this way, in fact outsystems help documentation explains this same behaviour "The Source Record variable is only copied once into the Form widget, after the screen Preparation finishes. Afterwards, when executing Screen Actions the values stored on the Source Record, will not be copied into the Form's implicit variable, ensuring the end-user input is never overwritten." Reference http://www.outsystems.com/help/servicestudio/9.0/Web_User_Interface/Form_Widget_Properties.htm

The Form/Editable variable should behave as described in outsystems documentation, it should load source record once and once only, even when you use Ajax refresh it should refresh the form UI elements only not the backend form/editable variable as well.  

Without access to the platform source code, I can not see what is actually going on

But what I could see is Ajax refresh reloads the entire widget including the source record variable itself, I know it works like this and how to correct it, but it shouldnt work like this at all, it should copy the variable only once and not reload the variable on a ajax refresh.

I'm not sure if both cases are similiar, but It looks like someone already had this problem too: 
Andre, that is a related issue, and it's a bug (that has not yet been fixed).
When is this being fixed?

This is an annoying misdesign since it doesn't work on editrecord and form.