Oracle Transactional Business Intelligence

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to use the Order Management Extension to retrieve attribute information using Standard Lookup?

Received Response
195
Views
4
Comments

We need to retrieve attribute information using standard lookup, but there are errors occurring during the retrieval process. 

Code:

import oracle.apps.scm.doo.common.extensions.ValidationException;

TransactionTypeCode = header.getAttribute("TransactionTypeCode");

BuyingPartyNumber = header.getAttribute("BuyingPartyNumber");


def lines = header.getAttribute("Lines");                               


while( lines.hasNext() ) {                                       

 def line = lines.next();                                       

 def itemNumber = line.getAttribute("ProductNumber");

 } 


def rules = getStandardLookupDetails("XXXXX_PRETRANSFORMATION_RULES");


while (rules.hasNext()) {

def rules_row = rules.next();

    throw new ValidationException("Unable to fetch Item Types from Lookup " + rules_row.getAttribute("AttributeChar1"));

}



Object getStandardLookupDetails(String lookupType) {

  def lookupPVO = context.getViewObject("oracle.apps.fnd.applcore.lookups.model.publicView.LookupPVO");

def vc = lookupPVO.createViewCriteria();

def vcrow = vc.createViewCriteriaRow();

vcrow.setAttribute("LookupType", lookupType);

vc.add(vcrow);

def rowset = lookupPVO.findByViewCriteria(vc, -1);

if (!rowset.hasNext()) {

throw new ValidationException("Unable to fetch Item Types from Lookup " + lookupType);

  }

return rowset;

}

Tagged:

Answers

  • Bhavani  Rikkula
    Bhavani Rikkula Rank 3 - Community Apprentice

    Hi Yash,

    I have a same requirement did you find any pvo for standard lookups that stores dff values.

    Thanks,

    Bhavani

  • Raj Jain-Oracle
    Raj Jain-Oracle Rank 1 - Community Starter

    Hi Team,

    I have also same requirement to get the DFF value present on standard lookup.

    I could not find any PVO which keep information of DFF.

    PVO: oracle.apps.fnd.applcore.lookups.model.publicView.LookupPVO was used to get the description , lookup code, tag data but for DFF, there is no field defined in this PVO.

    Please help.

  • User_8O1RL
    User_8O1RL Rank 1 - Community Starter

    Use Below Code to get DFF values

    def rules =getCommonLookupDFF("ComonLookupType" ,"CommonLookupCode");
    while (rules.hasNext())
    {
    def rules_row = rules.next();

      def attribute1= rules_row.getAttribute("Attribute1");      
    

    }

    //————————Lookup Defination

    Object getCommonLookupDFF(String LookupType , String LookupCode)
    {
    def lookupPVO = context.getViewObject("oracle.apps.fnd.applcore.lookups.model.publicView.CommonLookupPVO");
    def vc = lookupPVO.createViewCriteria();
    def vcrow = vc.createViewCriteriaRow();
    vcrow.setAttribute("LookupType", LookupType);
    vcrow.setAttribute("LookupCode", LookupCode);
    vc.add(vcrow);
    def rowset = lookupPVO.findByViewCriteria(vc, -1);
    if (!rowset.hasNext())
    {
    throw new ValidationException("Common Lookup Error , Unable to fetch Item Types from Lookup :" + lookupType);
    }

    return rowset;
    }

  • Rastislav Galat-Oracle
    Rastislav Galat-Oracle Rank 1 - Community Starter

    Just one comment, CommonLookupPVO does not contain the same lookup types as LookupPVO, e.g I defined many attributes for sales order type lookup ORA_DOO_ORDER_TYPES and when I use this value as LookupType in the function getCommonLookupDFF, the following error arises:

    On Save event couldn't be completed. oracle.jbo.JboException: JBO-29000: Unexpected exception caught: groovy.lang.MissingPropertyException, msg=No such property: lookupType 

    Regards,

    Rasto