Script Is Not Triggered After Updating Parent Account Value On Account Object (Doc ID 2100515.1)

Last updated on FEBRUARY 15, 2016

Applies to:

Oracle Fusion Sales Cloud Service - Version 11.1.10.0.0 and later
Information in this document applies to any platform.

Goal

The customer has the following script for a Before Update trigger on the Account object. When they are updating the value of the "Parent Account" field, the script is not triggered.

In the Account object they have two custom fields: Type_c and Tier_c.

The customer wants to set these two fields with values from Parent Account. How can this be achieved?

println ('Script Triggered')

if(isAttributeChanged ('ParentParty'))
{
def partyColl = ParentParty

if(nvl(partyColl,null) != null)

{
if(partyColl?.hasNext())
{
def row=partyColl?.next()

def customerId = row?.PartyId

def account = newView('OrganizationProfile')
adf.util.applyFilter(account,[PartyId:nvl(customerId,null)])
account.executeQuery()

if(account.hasNext())
{
def accRow = account.next()
setAttribute('Type_c',nvl(accRow?.Type_c, null))
setAttribute('Tier_c',nvl(accRow?.Tier_c,null))
}
}
}
}
 

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