Upon Creating Partner Record Getting Error (Doc ID 2140305.1)

Last updated on JULY 28, 2017

Applies to:

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

Symptoms

Upon creating Partner Record getting error because of some groovy.



ERROR
-----------------------
Exception in expression "PartnerProfilePEO.BrokerEmpanelmentlnCREAM_ATTR":java.lang.NullPointerException : Cannot get property 'Location' on null object at "PartnerProfilePEO.BrokerEmpanelmentlnCREAM_ATTR" expression line 21



STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. simplified UI > Partners > Create Partner


//adf.webServices.CreamOSCIntWebServices.brokerUpdate(B_empNo, SUPPLIER_NAME, OSC_RECORD_ID, PHONE_NUMBER, EMAIL_ADDRESS, FIRST_NAME, MIDDLE_NAME, LAST_NAME, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11, ATTRIBUTE12, PAN_NO, SERVICE_TAX_REG, SUPPLIER_SITE_NAME, ADDRESS_LINE1, COUNTRY)

if(isAttributeChanged('P_EmpanelmentStatus_c'))
{
def OutCome = '';
def SUPPLIER_NAME = nvl(OrganizationName,'');
def OSC_RECORD_ID = CompanyNumber;
def PHONE_NUMBER = nvl(PrefferedContactPhone,'');
def EMAIL_ADDRESS = nvl(PrefferedContactEmail,'');
def FIRST_NAME = nvl(P_BrokerFirstName_c,'');
def MIDDLE_NAME = nvl(P_BrokerMiddleName_c,'');
def LAST_NAME = nvl(P_BrokerLastName_c,'');
def ATTRIBUTE9 = nvl(P_Category_c,'');
def ATTRIBUTE10 = nvl(OwnerName,'');
def ATTRIBUTE11 = nvl(P_EmpanelmentStatus_c,'');
def ATTRIBUTE12 = nvl(P_CINNo_c,'');
def PAN_NO = nvl(P_PANNo_c,'');
def SERVICE_TAX_REG = nvl(P_ServiceTaxNo_c,'');
def SUPPLIER_SITE_NAME = nvl(City,'');
def ps = PartySite;
def loc = ps?.next().Location;
def ADDRESS_LINE1 = nvl(loc.Address1,'');
def ADDRESS_LINE2 = nvl(loc.Address2,'');
def ADDRESS_LINE3 = nvl(loc.Address3,'');
def CTY = nvl(loc.City,'');
def STAT = nvl(loc.State,'');
def PCODE = nvl(loc.PostalCode,'');
def COUNTRY = nvl(loc.Country,'');
def ChnlMngr = nvl(AccountDirectorId,'');
def ChnlMngrN ='';

switch (ChnlMngr) {
case '300000001079008'://Kushal
ChnlMngrN = 'P3175'
break
case '300000001076088'://Sandeep
ChnlMngrN = 'P3197'
break
case '300000001080039'://Amit
ChnlMngrN = 'P3190'
break
case '300000001084119'://Kapil
ChnlMngrN = 'P3212'
break
case '300000001081070'://Gurbax
ChnlMngrN = 'P3187'
break
case '300000001082101'://RamanDeep
ChnlMngrN = 'P3178'
break
case '300000001408008'://Mukul Sharma
ChnlMngrN = 'P3123'
break

default:
ChnlMngrN = 'NullValue'
}
println("Value of SUPPLIER_NAME =" + SUPPLIER_NAME + " Value of OSC_RECORD_ID = " + OSC_RECORD_ID + " Value of PHONE_NUMBER = " + PHONE_NUMBER + " Value of EMAIL_ADDRESS = " + EMAIL_ADDRESS + " Value of FIRST_NAME = " + FIRST_NAME + " Value of MIDDLE_NAME = " + MIDDLE_NAME + " Value of LAST_NAME = " + LAST_NAME + " Value of ATTRIBUTE9 = " + ATTRIBUTE9 + " Value of ATTRIBUTE10 = " + ATTRIBUTE10 + " Value of ATTRIBUTE11 = " + ATTRIBUTE11 + " Value of ATTRIBUTE12 = " + ATTRIBUTE12 + " Value of PAN_NO = " + PAN_NO + " Value of SERVICE_TAX_REG = " + SERVICE_TAX_REG + " Value of SUPPLIER_SITE_NAME = " + SUPPLIER_SITE_NAME + " Value of ADDRESS_LINE1 = " + ADDRESS_LINE1+" Value of ADDRESS_LINE2 = " + ADDRESS_LINE2+" Value of ADDRESS_LINE3 = " + ADDRESS_LINE3+ " Value of CITY = " + CTY+ " Value of STATE = " + STAT+ " Value of POSTALCODE = " + PCODE+ " Value of COUNTRY = " + COUNTRY+ "Value of ChnlMngrN = "+ ChnlMngrN) // this is the prointln
if(ATTRIBUTE11 == 'EMPANELLED')
{
//println("Value of OSCID1 =" + OSC_RECORD_ID)
OutCome = adf.webServices.CreamOSCIntWebServices.brokerUpdate(ChnlMngrN, SUPPLIER_NAME, OSC_RECORD_ID, PHONE_NUMBER, EMAIL_ADDRESS, FIRST_NAME, MIDDLE_NAME, LAST_NAME, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11, ATTRIBUTE12, PAN_NO, SERVICE_TAX_REG, SUPPLIER_SITE_NAME, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_LINE3,CTY, STAT,PCODE, COUNTRY)
println("Value of OSCID2 =" + OSC_RECORD_ID)
setAttribute('P_BrokerEmpanelStatus_c', OutCome)
}
println("Value of OutCome =" + OutCome)
}

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