Tuesday 5 May 2020

Record Association and Disassociation in Siebel : MVG Applets

Hello All,

We have many time worked wth MVG Applets, where 2 Applets opens in Form of Shuttle applet.
The one of left is Associate applet and Right is MVG Applet.

When we Move record from Assoc to MVG is called Association, and Removing/Deleting from MVG is called Disassociation.



Recently i had a requirement wherein i had to perform Association, and update some field in Asso BC to keep some check
i.e. Suppose we are associating a custom entity "Vouchers" with a Account, and once we associate the Voucher we want to update a field in Voucher say Account Name, so that it does not appear again in Assoc list to prevent it from multiple tagging

and the same way we wanted to Nullify the Field, Account Name on the Voucher when Disassociation happen.

Choosing the Events:

Association triggers Associate Event of Corresponding Business Component, so update a field value of assoc BC when Association happen we will have to write script in Associate Event.


function BusComp_Associate ()
{
var AccNum = this.ParentBusComp().GetFieldValue("CSN Number");//to get the field in corresponging parent BC
ActivateField("Account Number"); 
SetFieldValue("Account Number", AccNum);       
WriteRecord(); 

}

There is no such event Disassociate in siebel, rather DeleteRecord is triggered when Disassociation occurs, so to remove the field value we can use Delete event.
I am using preDelete event, to make my code run before the record is deleted.

function BusComp_PreDeleteRecord ()
{
ActivateField("Account Number"); 
SetFieldValue("Account Number", ""); 
WriteRecord(); 
return (ContinueOperation);
}

we will explore how to associate/disassociate from different BC, in our next post

No comments:

Post a Comment

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...