Unable To Insert A Record In To Custom Object Using Groovy When Account Is Deleted (Doc ID 1682245.1)

Last updated on JANUARY 26, 2016

Applies to:

Oracle Fusion CRM Application Composer Cloud Service - Version 11.1.7.0.0 and later
Information in this document applies to any platform.

Symptoms

Tried to insert a row in to Custom Object whenever an account is deleted

The record is inserted as per the log message. But on the UI, we are not able to see the record inserted.

 

Reproducible Steps

1. Place trigger under After Update in Database and no row is created for the custom object.
2. Place the trigger under After Changed Posted in Database and two rows are created for the custom object

The script used is:

def result
def recordId=PartyId
def recordType="Account"
def operationType="Delete"
if (isAttributeChanged('PartyStatus') && PartyStatus!='A')
{
 println("Account Deleted "+PartyId)

//result=adf.webServices.GB_Rohm_Delete_Service.processDeleteRecordstoFile(rec

ordId, recordType, operationType)

def vo = newView('Deleted_OUTQ_c')
def Rec = vo.createRow()
Rec.setAttribute('recordId_c',recordId)
Rec.setAttribute('operationType_c',"Delete")
Rec.setAttribute('recordType_c',"Account")
//Rec.setAttribute('CreatedBy',"gbyahatti")
//Rec.setAttribute('CurrencyCode',"JPY")
//Rec.setAttribute('LastUpdatedBy',"gbyahatti")
//Rec.setAttribute('LastUpdateDate',today())
//Rec.setAttribute('CreationDate',today())

vo.insertRow(Rec)
println("row inserted")
}
return true

 

 

Cause

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