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”); }
Sunday, June 1, 2008
On Field Update Invoke
The On Field Update Invoke user property is a clean way to run some custom functionality when a BusComp field is updated. If you reflexively assume that you need to put script in the SetFieldValue event, you should consider this user property to execute your specialized functionality instead.The syntax is as follows:User Property Name: On Field Update Invoke nUser Property Value: "[FieldToCheck]", "[BusCompName]", "[MethodName]", "[Condition]"Condition is an optional parameter. If you leave it out, the method will be called any time the field is updated. If you include it, the condition must be true for the method to be invoked.FieldToCheck is also optional. If the parameter is omitted, include double quotes as a placeholder. The method will be invoked any time the BusComp is updated, as if it were called from the BusComp_WriteRecord event. If the parameter is present, the user property works just like BusComp_SetFieldValue; the update happens as soon as the cursor leaves the FieldToCheck field.Note that you can run a BusComp method on a different BusComp than the one that spawns the event. Specify the BusCompName and the MethodName. Siebel does this quite extensively (for updating child records when a parent record is updated, for example) to implement vanilla functionality. The BusComp method is invoked on another business component in the active Business Object.It is also important to understand what methods can be called from this user property. It can be used to call an eScript function. You can add eScript to the BusComp_PreInvokeMethod event to capture the invocation and call a function on the current BusComp, and from there invoke a workflow process or business service. The user property can also invoke methods on the Business Component Class that would normally be invoked through the InvokeMethod method. For example, you could call the CompleteActivity method on an Activity. Be aware of the specialized methods that are available for the class you are using.If your implementation includes Siebel Order Management, Signals can also be raised from this user property. For any of the Order Management Business Components, if a method is not found on the business component itself, Siebel will raise a signal if it exists.Whatever you choose, Siebel recommends the On Field Update Invoke user property as preferable to adding scripting to the BusComp_SetFieldValue event. The SetFieldValue event is inefficient, and even though the On Field Update Invoke user property may invoke a custom script, it can be more efficient than invoking the same script from the SetFieldValue event.
Subscribe to:
Posts (Atom)