Hi All,
I have a function that I need to run when a form is first opened, however I don't want to to run anymore after that. I can't seem to find any information on how to do this. I thought about adding a value to some OBS at the completion of the function and then checking for the value at the start. I have to believe there is a way to do this without this type of work around.
If this is possible and someone could point me in the right direction that would be very helpful.
Thanks,
Heath
The issue is executing the function only once, upon initial loading.
Create a document variable on your form called document.Form_Loaded, or equivalent. Within the Initialize_All() function, the last statement of should set the document variable to something, e.g. document.Form_Loaded="yes". In the translation of the variable, include the statement {if document.Form_Loadad<>"yes" then Initial_Form() "" else "" endif}
The reason for this subterfuge is that executing a functions at load may or may not be completed when the form is displayed, that is the reason for the translation code. Please contact me directly if you wish further information.
The initial screen shot is a Coumadin form that uses this technique. The highlighted area is the subdued display of document.Form_Loaded. The function Initialize_All() is called by the text translation. The last line of the function sets the variable to "yes"
Thanks for the help!
Pretty much kind of what I was thinking except using an OBS. I also wouldn't have thought of placing the if statement in the translation which was very helpful and worked like a charm.
Thanks again!
Heath