Test the Global Methods using Triggers
Now create triggers to test your global methods.
-
In Application Composer, expand Standard Objects > Contact > Server Scripts..
-
Click the Triggers tab.
-
Click the Add a new Trigger icon.
-
Click the Trigger drop down list and select Before Update in Database from the Trigger.
-
In the Trigger Name field, enter:
test_sync_contact_attributes
. -
Copy the following code and paste it in the Trigger Definition field:
def contactPartyId = PartyId + "" def firstName = PersonFirstName def lastName = PersonLastName adf.util.syncContactAttributes(contactPartyId, firstName, lastName)
-
In the Contacts UI of the Fusion Service application, make a change to any self-service contact and make sure the script worked.
-
Once your testing and corrections are made, you can remove this trigger.