GROOVY RETRIEVES DIFFERENT VALUES WHEN CALLED FOR TASK VS. APPOINTMENT (Doc ID 2221228.1)

Last updated on JANUARY 09, 2017

Applies to:

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

Goal

Customer has a custom object related to Account with DCL. Also, from Activity they have a DCL to the custom object and created a subtab in the custom object for Activity.
Requirement: when creating an activity FROM a custom object record, they need the Account field to be populated with the Account related to the custom object.
PROBLEM: The same script that works to retrieve Account name and Account Party id, when we click on CREATE TASK is retrieving some other info than when we click on CREATE APPOINTMENT.

 

Script we tested is:

 

def myval;
def obj;
def AcctObject = newView('OrganizationProfile');
def vc = newViewCriteria(AcctObject);
def vcr = vc.createRow()
def vci = vcr.ensureCriteriaItem('OrganizationName')
vci.setOperator('=')
vci.setValue(val)
vc.insertRow(vcr)
AcctObject.appendViewCriteria(vc)
AcctObject.executeQuery()
while (AcctObject.hasNext()) {
obj= AcctObject.next()
myval = obj.getAttribute('PartyId');
}
setAttribute('ActivityDescription',val + ' ' + myval)
 

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