Tuesday, May 27, 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 n
User 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.

5 comments:

Anonymous said...

Thanks Jim.. this post was really helpful

vishnu Sharma said...

hai
iam telling very sorry to you missing this blog from few days
i really appreciate ur attitude in sharing ur ideas through learners and techies by the way iam working as siebel configurator but i feel i dont have much idea about siebel so can you explain about workflows and datavalidation manager through supportive meterial thanks in advance

Remitha said...

Thanks Jim..well said about this user property.The post is really helpful.

Anonymous said...

Hi Jim,

Can you please let me know if it possible to do an 'On Field Update' based on the value set in a calculated field in Siebel 6?

Eg.:
"Sample Calc", "Sample", "[Sample Calc]" - Is this possible?

Jim Uicker said...

Hi Anonymous!

In the example you provided, I'm guessing that "Sample Calc" is both the name of the field and the name of the method to call. I'm a little confused by that.

I don't currently have a Siebel 6 implementation to test with, or even a copy of Siebel 6 Bookshelf, but to the best of my memory, "On Field Update Invoke" existed but was not documented or supported for customer use with that version. I could be wrong, though. I'm only going from memory.

I can tell you that this user property has been documented in Bookshelf since 7.5, but as you know, Siebel 6 is practically different application.

-- Jim