Error In Loop Revenue Line Records - Groovy Script
(Doc ID 2248282.1)
Last updated on NOVEMBER 27, 2019
Applies to:Oracle Fusion Sales Cloud Service - Version 126.96.36.199.0 to 188.8.131.52.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
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