Hi all,
I have a form with a action button “Save & Close” with the formula:
@Command([FileSave]);
@Command([FileCloseWindow]);
In the form , i have a hotspot button (Button 1). When user press the Button 1, it will run an agent, and the agent will perform some tasks and will set a field called “Generated” to “Yes” in this form. If Generated = “Yes”, then it will hide the Button 1 so that user can not press it anymore. Generated is a hidden editable field with null value.
So, the problem is, after running the agent, the user press “Save & Close”, and when i go back and check again, the Generated field is not set properly. But if user did not press the Save & Close, then it will set properly…I know it is the @command([FileSave]) which causes the problem, but i just dont know how to solve it. The “Save & Close” button is necessary in some situations so i cant disable it…
Any helps ? Thanks.
Part of the agent’s code:
…
curdoc.Generated = “Yes”;
call curdoc.Save(True,False);
…