Set Date of Birth with Value from Contact
You must set the date of birth with value from contact
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 Field Triggers section, click New icon.
-
For the field name, select Primary Contact ID.
-
Enter the trigger name as PrimaryContactChanged.
-
Add the following groovy code in trigger definition:
def vo = newView('PersonProfile') if (isAttributeChanged('PrimaryContactPartyId') && PrimaryContactPartyId != null){ def foundRows = vo.findByKey(key(PrimaryContactPartyId),1) if (foundRows != null){ def found = foundRows.size() == 1 ? foundRows[0] : null; if (found != null) { DateOfBirth_c = found.getAttribute("DateOfBirth") } } }
-
Click Save and Close.