After R12 Upgrade, The Trigger That Checks Whether The Company Name Already Exists Throws Error.

(Doc ID 2314698.1)

Last updated on OCTOBER 09, 2017

Applies to:

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

Symptoms

On 11.12.1.0.0 version, Leads
 

ACTUAL BEHAVIOR
---------------
After upgrading the DEV environment to R12, the trigger that checks whether the account name already exists, during lead conversion always throws an error that "there is an account already exists with the name".Even though the account does not exist, the application throws the error. This customization was working in R11.

STEPS
-----------------------

1) Before update trigger on Sales Lead Entity
2) if(SalesAccountPartyId == null && StatusCode == 'CONVERTED')
{
def lead_account_name = nvl(AccountName,"")
def account_view = newView('OrganizationProfile')
def creiteriuCont = newViewCriteria(account_view)
def randCont = creiteriuCont.createRow()
def c1 = randCont.ensureCriteriaItem('OrganizationName')
c1.setOperator('=')
c1.setValue(lead_account_name)
def c2 = randCont.ensureCriteriaItem('PartyStatus')
c2.setOperator('=')
c2.setValue("A")
creiteriuCont.insertRow(randCont)
account_view.appendViewCriteria(creiteriuCont)
account_view.executeQuery()

def count = account_view.getEstimatedRowCount()
  
println("The account available count is" + count)

if(count >0)
{
throw new oracle.jbo.ValidationException('There is already an account with the name of: ' + lead_account_name)
}

}
else
{
return false
}

Customer Visible


BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Unable to convert leads

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