Error In Loop Revenue Line Records - Groovy Script
Last updated on JULY 28, 2017
Applies to:Oracle Fusion Sales Cloud Service - Version 188.8.131.52.0 to 184.108.40.206.0 [Release 1.0]
Information in this document applies to any platform.
Error in Loop Revenue Line Records - Groovy Script
Added an object trigger that checks Revenue Line's status and updates the Oppty Header status
Logic: Loop all revenue lines, if all revenue line status is "LOST", Opportunity Sales Stage should be set to Closed.
Object Trigger Created (Opportunity), Before Update in Database
What is working:
1. The script works if there's only 1 Revenue Line. Loops all parent and child revenue lines as expected.
The issue can be reproduced at will with the following steps:
Login to OSC --> Application composer --> server scripts --> create a grooy script
def Counter = 0
if(revenueLines != null)
revnLine = revenueLines.next()
revnId = revnLine.getAttribute('RevnId')
status = revnLine.getAttribute('StatusCode')
RecurType = revnLine.getAttribute('RecurTypeCode')
SalesStageId = getAttribute('SalesStageId')
SalesStage = getAttribute('SalesStage')
//count if revenue line has status not equal to LOST and Recurring Type = PARENTRECUR
if(status!='LOST' && RecurType=='PARENTRECUR')
Counter = Counter + 1
if(Counter == 0)
//sets Opportunity SalesStage to 07 - Closed.
An application error had encountered, please see the incident log for more details
The issue has the following business impact:
Due to this issue, users cannot save the opportunities with multiple revenue items
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