Sunday, June 1, 2008

BC UndoRecord – a new learning

BC UndoRecord Method.
Requirement:
If user changes a field value make a flag true
If user hits ESC key or does an undo record then set the flag to false.
Solution:
On SetField value event write the script to make the set the flag as true.Problem:
The problem that we faced was:
If user changes the value the flag is set to true but if user click on Undo Record or hits ESC key then that flag was not being set to false. We explicitly coded in PreInvoke of BC
if (MethodName == “UndoRecord”){ Set the flag to false}
But this code was not firing.
Reason:
BC UndoRecord is only called if user does something which results in ChangeRecord event to fire. In simple words BC UndoRecord is only called if user copies or creates a new record and hits ESC key.
In case user changes a field value and then hits ESC key only Applet Undo Record is called not BC UndoRecord method
Solution:
On Applet write the following script.
if (MethodName == “UndoRecord”){ this.BusComp().InvokeMethod(“UndoRecord”); }

No comments: