Groovy Script Update To EffectiveDate Causing All Revenue Items EffectiveDate To Also Be Updated (Doc ID 2128438.1)

Last updated on JUNE 22, 2017

Applies to:

Oracle Fusion Sales - Version 11.1.8.0.0 to 11.1.11.1.0 [Release 1.0]
Information in this document applies to any platform.

Goal

Groovy Script Update to EffectiveDate Causing All Revenue Items EffectiveDate to also be updated

We added the following groovy script to BeforeInsert and BeforeUpdate to Database for Sales Opportunity Script in Oracle Composer:

/* Set Opportunity Date to greatest Revenue Line Date */
try{
def dtChange = 0;
def opptyDt = getAttribute('EffectiveDate');
def myRevenue = nvl(ChildRevenue,0);
while(myRevenue.hasNext()) {
  def myLine = myRevenue.next();
  if(myLine.getAttribute('EffectiveDate') > opptyDt){
  opptyDt=myLine.getAttribute('EffectiveDate');
  dtChange=1;
  }
}
  if(dtChange==1){
  setAttribute('EffectiveDate', opptyDt);
  }

What we are experiencing is that when a user go in and add a revenue item that is > than the Opportunity Effective Date, it updates that Opportunity Effective Date as we want it to, BUT IT ALSO updates every revenue item Effective Date to that same date. Somehow this seems to be happening automatically and we'd like to find out if there is a setting/configuration change to turn this off.
 

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