Groovy Script Written On Opportunity Object Not Working For The First Time (Doc ID 2128420.1)

Last updated on JUNE 22, 2017

Applies to:

Oracle Fusion Sales Cloud Service - Version 11.1.10.0.0 to 11.1.10.0.0 [Release 1.0]
Information in this document applies to any platform.

Goal

Groovy Script written on Opportunity Object not working for the first time. When the changes are made for the second time it trigger up and work correctly.

 def userName = adf.context.getSecurityContext()?.getUserName()
 def resource = newView('Resource')
 adf.util.applyFilter(resource,[Username:userName])
 resource.executeQuery()
 if(resource.hasNext())
 {
def curRow = resource.next()
def partyId = curRow?.ResourceProfileId
  setAttribute('RegistrationDispositionBy_Id_c',partyId)
 
 }

STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Navigate to an Opportunity
2. Edit an Opportunity and click on Save
3. The field specified in the screenshot 'Registration Disposition By' is not updated with the value
4. Make some changes and save the opportunity later and the value in the field 'Registration Disposition By' is reflected correctly
 

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