Schedule Custom Groovy Script Process Is Not Updating All The Records
(Doc ID 2717682.1)
Last updated on OCTOBER 17, 2023
Applies to:
Oracle Fusion CX Sales Cloud Service - Version 11.13.20.07.0 and laterInformation in this document applies to any platform.
Symptoms
User is scheduling the groovy script to update address custom field but its not working as expected.
Schedule process status is showing as success but its updating only few records in the address.
STEPS
1. Create custom fields on Address object :
Name Display Name Type Column Name
GDMS_CustomerAccountId_c Customer Account Id Text EXTN_ATTRIBUTE_CHAR007
GDMS_CustomerAccount_c Customer Account Name Text EXTN_ATTRIBUTE_CHAR006
GDMS_SiteUseId_c SiteUseId Number EXTN_ATTRIBUTE_NUMBER004
GDMS_Address_c Address Text EXTN_ATTRIBUTE_CHAR003
2. Create server script
Apps Composer > Objects > Standard Object > Activity > Server Scripts > Object Function > Account_Address
Portion of the script :
def voOrg = newView('Address')
def vcOrg = newViewCriteria(voOrg);
def vcrOrg = vcOrg.createRow();
def vciOrg = vcrOrg.ensureCriteriaItem('GDMS_CustomerAccount_c');
vciOrg.setOperator('=');
vciOrg.setValue('');
vcOrg.insertRow(vcrOrg);
voOrg.appendViewCriteria(vcOrg);
voOrg.setMaxFetchSize(1000)
voOrg.executeQuery();
if(voOrg.hasNext())
{
while(voOrg.hasNext())
{
def OrgObj = voOrg.next();
def partyid = OrgObj.getAttribute('PartyId')
def PartySite = OrgObj.getAttribute('PartySiteId')
try
{
def findCriteria =
[
fetchStart :0,
fetchSize :-1,
excludeAttribute :false,
filter:
... etc ...
def res = adf.webServices.AR_Customer_Account.findCustomerAccount(findCriteria, findControl)
def custAcctId = res[0].Value[0].CustomerAccountId
def acctName = res[0].Value[0].AccountName
OrgObj.setAttribute('GDMS_CustomerAccountId_c',custAcctId)
OrgObj.setAttribute('GDMS_CustomerAccount_c',acctName)
}
catch (Exception e)
{
String errorMsg = e;
String Object = "Activity";
String failedRecord = "Address";
adf.util.ErrorHandler(errorMsg, Object, failedRecord);
}
}
}
3. Run Schedule Processes : Schedule Custom Groovy Object Functions
Parameters :
Schedule Object - Activity
Object Function - Account_Address
4. Run BI analysis on subject area "Sales - CRM All Contacts Addresses"
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |