CPS 12
I have a function that works correctly, but not until I open the form and then click on a different tab or different form and then come back to it. When initially opened the data display fields read VOID.
After clicking on a different tab or form and then coming back, they all display the date as expected.
Any ideas on how to make the correct informaion load the first time the form is opened?
Thanks in Advance.
Do you have this listed as a watcher function? Specifically, do you have the exclamation mark in front of your function definition?
{ !fn this_is_my_funct() {
do function stuff here
}}
The exclamation mark with force it to run before the screen is displayed.
This is the MEL expression currently in the data display:
{! if (fnSeriesVaxDt(DOCUMENT.HEPBHTMLV,1)"") then fnSeriesVaxDt(DOCUMENT.HEPBHTMLV,1) else fnWhichOne("Hep B",1) endif}
You have an timing issue on loading of the form. Initializing forms with a { ! FunctionCall()} tends to fails. Suggest setting up a field on the form, document.form_loaded, no label, transparent, dark gray text. In the translation of this field, {if document.form_loaded<>"yes" then FunctionCall() "" else "" endif} The null quotes are important. Take out the {! FunctionCall()} and instead standard function routine, { fn FunctionCall() { ........, last line of function document.form_loaded="yes"}}. Let me know if this does, doesn't solve your problem.
Thanks.
This is actually 60 different data displays, would I add { fn FunctionCall() { ........, last line of function document.form_loaded="yes"}} to each one?
So - did you get this resolved ? What worked ? - B