Set Service Request Contact List from Contact Relationships
You must set service request contact list from contact relationships.
Following are the steps:
-
Sign in to Oracle CX Sales using Administrator role.
-
Navigate to Application Composer.
-
Go to Service Request > Server Scripts > Triggers.
-
In the Object Triggers section, click New icon.
-
For the trigger, select Before Insert in Database.
-
Enter the trigger name as InsertRecord.
-
Add the following groovy code in trigger definition:
if (Type_c == "DECEASED_ESTATE" && ContactPerson != null) { def conVO = contacts ArrayList contactParties = new ArrayList() while (conVO.hasNext()) { def con = conVO.next() contactParties.add(con.PersonProfileId) } def relVO = ContactPerson.Relationship while (relVO.hasNext()) { def relation = relVO.next() if (relation.ObjectType == "PERSON" && contactParties.indexOf(relation.ObjectId) == -1) { def relationCopy = conVO.createRow() relationCopy.setAttribute("SrId",SrId) relationCopy.setAttribute("ContactPartyName",relation.ObjectPartyName) relationCopy.setAttribute("PartyId",relation.ObjectId) relationCopy.setAttribute("Relationship_c",relation.RelationCode) conVO.insertRow(relationCopy) } } }
-
Click Save and Close.