Set Date of Birth with Value from Contact

You must set the date of birth with value from contact

Following are the steps:

  1. Sign in to Oracle CX Sales using Administrator role.

  2. Navigate to Application Composer.

  3. Go to Service Request > Server Scripts > Triggers.

  4. In the Field Triggers section, click New icon.

  5. For the field name, select Primary Contact ID.

  6. Enter the trigger name as PrimaryContactChanged.

  7. 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")
      } 
     }
    } 
  8. Click Save and Close.