Groovy Script Not Triggering On Contact Points (Doc ID 2246472.1)

Last updated on MARCH 22, 2017

Applies to:

Oracle Fusion Sales - Version 11.1.11.1.0 to 11.1.11.1.0 [Release 1.0]
Information in this document applies to any platform.

Goal

Making changes to Primary Contact Phone number and want to stamp this value to a custom field.


def countryCode
def areaCode
def phoneNumber

def phoneobj = Phone
def primaryPhoneObject
  while(phoneobj.hasNext())
  {
  
  def phone = phoneobj.next()
  if(phoneRow.getPrimaryRowState().isModified()){
  
  // then do something
  }
  def primary = phone.PrimaryFlag
  
  if(primary == 'Y') {
  primaryPhoneObject = phone ;
  }
  
  }




if (isAttributeChanged(primaryPhoneObject?.PhoneNumber))
{
countryCode = primaryPhoneObject.getAttribute('PhoneCountryCode');
areaCode = primaryPhoneObject.getAttribute('PhoneAreaCode');
phoneNumber = primaryPhoneObject.getAttribute('PhoneNumber');
def origPhoneNumber = getOriginalAttributeValue('phoneNumber')
  if(phoneNumber != origPhoneNumber)
  {
def phonePortal = countryCode+areaCode+phoneNumber
println("the portal number:"+phonePortal);
setAttribute('Comments','Y');
setAttribute('PortalPhoneNumber_c',phonePortal);
}
}
 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms