Test the Global Methods using Triggers

Now create triggers to test your global methods.

  1. In Application Composer, expand Standard Objects > Contact > Server Scripts..

  2. Click the Triggers tab.

  3. Click the Add a new Trigger icon.

  4. Click the Trigger drop down list and select Before Update in Database from the Trigger.

  5. In the Trigger Name field, enter: test_sync_contact_attributes.

  6. 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)
  7. In the Contacts UI of the Fusion Service application, make a change to any self-service contact and make sure the script worked.

  8. Once your testing and corrections are made, you can remove this trigger.