Unable To Access Custom Fields Of Product Group Object Through Groovy (Doc ID 2109797.1)

Last updated on JUNE 23, 2017

Applies to:

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

Goal

User wants to add custom attributes to Product Group which is working fine.
They are able to add three attributes BU, NewBU and Product Category.
They have similar fields BU and product Category and when they add a Product Group in Opty revenue lines, they want the associated BU and Product category
to be populated on Oppty, And they are not able to do it.

Unable to access custom fields of Product Group Object through groovy

User created two fields with names “BU” and “Product Category” under Product Group object.
These fields are available while creating product group. But when they are try accessing these two fields through groovy, they get an error message that “Attribute not found”.

def varx = ProdGroupName
println('This is selected group in trigger'+varx)
def pbu
def pcategory

def pvo = ProductGroupDetail

while (pvo.hasNext()) {
  println('THids is inside group view in trigger')

  def prow = pvo.next()
  def pname = prow.getAttribute('ProdGroupName')
  println('This is group name in view'+pname)
  
  if(pname == varx){
  
  pbu = prow.getAttribute(‘BU_c’)
  println('This is bu name'+pbu)
  pcategory = prow.getAttribute(‘Category_c’)
  println('This is category name '+pbu)

  }
  
}

Above piece of code is written inside Before Update trigger under “Opportunity Revenue”.
 

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