Outlook Script Required For Mandatory Fields On Sales Stage Closed (Doc ID 2036268.1)

Last updated on NOVEMBER 03, 2016

Applies to:

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

Goal

Sales Stage “7: Closed” – The PO Number field and Signed Contract checkbox is required to be mandatory and the opportunity should throw an error if they are blank while saving.
 
Groovy Script is:

PONumberValidationCheck

def salesStage = SalesStage

if(salesStage == "07 - Closed"){
  
  def childRevenue = ChildRevenue
  
  while(childRevenue.hasNext()){
  
  def eachRevenue = childRevenue.next()
  
  def poNumber = nvl(eachRevenue.PONumber_c,"Empty")
  
  if(poNumber == "Empty"){
  
  throw new oracle.jbo.ValidationException("PO Number is mandatory when Sales Stage is 07 - Closed")
  
  }
  
  }
  
}

def salesStage = SalesStage

if(salesStage == "07 - Closed"){
  
  def childRevenue = ChildRevenue
  
  while(childRevenue.hasNext()){
  
  def eachRevenue = childRevenue.next()
  
  def poNumber = nvl(eachRevenue.PONumber_c,"Empty")
  
  if(poNumber == "Empty"){
  
  throw new oracle.jbo.ValidationException("PO Number is mandatory when Sales Stage is 07 - Closed.")
  
  }
  
  }
  
}
 

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