My Oracle Support Banner

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

Last updated on MARCH 24, 2019

Applies to:

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


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 =
  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”.


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

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.