Hi all,
I have a solution where I need to copy the contents of whatever the current selected field into a global. Unfortunately, I have over 40 fields(columns) in the layout.
Is there a way do just copy over the content of whichever field the user selects? It would be easy if there is a function to get the current field name.
Please help.
thanks!
Sammy Zheng
Hi Sammy,
There is such a function: Application.getMethodTriggerElementName().
There is however 1 pre-requisition for this to use it.
All your 40 fields have to have the name property filled in.
After you have done that you can create a method that looks like this:
var curElement = Application.getMethodTriggerElementName();
globals.myGlobalVariable = elements[curElement];
Attach this method to the onFocusGained event of all 40 fields and you are set.
Hope this helps.
ROCLASI:
Hi Sammy,
There is such a function: Application.getMethodTriggerElementName().
There is however 1 pre-requisition for this to use it.
All your 40 fields have to have the name property filled in.
After you have done that you can create a method that looks like this:
var curElement = Application.getMethodTriggerElementName();
globals.myGlobalVariable = elements[curElement];
Attach this method to the onFocusGained event of all 40 fields and you are set.
Hope this helps.
Hey Robert!
thanks again for the quick reply as always. Worked like a charm. Again, nice meeting you at Servoy world.