Order Management

Get Involved. Join the Conversation.

Topic

    Zia Ansari
    Using Standard or Custom Lookup Tables in OM Extensions.
    Topic posted September 28, 2018 by Zia AnsariRed Ribbon: 250+ Points, tagged Order Management 
    77 Views, 3 Comments
    Title:
    Using Standard or Custom Lookup Tables in OM Extensions.
    Content:

    Hi Guys,

    Is it possible to read data from standard or custom lookups and use it in OM Extensions. If yes, please share the details.

    Regards,

    Zia

    Version:
    R13

    Comment

     

    • Balaji Narasimhan

      Hello Zia,

      Please check this out for details on PVOs and if that helps:

      oracle/apps/fnd/applcore/lookups/model/publicView/LookupPVO

      Best Regards

      Balaji

       

    • Binoj Kumaran

      As per below notes this PVO "/oracle/apps/fnd/applcore/lookups/model/publicView/LookupPVO.xml" are to be used for that

      How To Call Value From FND_LOOKUP Table In Order Management Extension(Groovy Script)? (Doc ID 2594340.1)

      But I am facing issue with this PVO. If I use this PVO with xml and it threw this error
      /oracle/apps/fnd/applcore/lookups/model/publicView/LookupPVO.xml

      An error occurred when running extension Excluding Order from Lookup, during event On Save: oracle.jbo.JboException: Only public view objects can be accessed in extension code. (DOO-2685874)

      Then i tried the same PVO without xml and it threw below error

      An error occurred when running extension Excluding Order from Lookup, during event On Save: oracle.jbo.InvalidDefNameException: JBO-25004: Definition name /oracle/apps/fnd/applcore/lookups/model/publicView/LookupPVO of type View Definition is invalid.. (DOO-2685874)

      My requirement is:

      I have a custom lookup which has PartySiteID in the lookup code.
      By using the groovy script, i need to validate the ShipToPartySiteIdentifier in OM cloud and verify that in the lookup
      If its there, it would throw a validation exception error message while saving the orders

      --

      I am using below script

      import oracle.apps.scm.doo.common.extensions.ValidationException; // import the pkgs that standard classes belong to.

      def customerPONumber = header.getAttribute("CustomerPONumber");
      if( !customerPONumber.startsWith("EDI") ) return;

      def OrderSource = header.getAttribute("SourceTransactionSystem");
      //if(OrderSource != ("EDI") ) return;
      def ShipToSiteID = header.getAttribute("ShipToPartySiteIdentifier");
      def vo = context.getViewObject("/oracle/apps/fnd/applcore/lookups/model/publicView/LookupPVO.xml");
      def Lookup = "WD_EDI_RETAIL_SITES";
      def vc = vo.createViewCriteria();
      def vcrow = vc.createViewCriteriaRow();
      vcrow.setAttribute("LookupType", Lookup);
      vc.add(vcrow);

      def rowset = vo.findByViewCriteria(vc, 1);
      if(rowset.hasNext() ) {
      def vcSameOrder = vo.createViewCriteria();
      def vcSameOrderrow = vc.createViewCriteriaRow();
      vcSameOrderrow.setAttribute("LookupCode", ShipToSiteID);
      vcSameOrder.add(vcSameOrderrow);

      def rowsetSameOrder = vo.findByViewCriteria(vcSameOrder, 1);
      if(rowsetSameOrder.hasNext() )
      {throw new ValidationException("WD: Retail Orders are not in scope");}



       

    • Binoj Kumaran

      Issue Resolved after correcting the PVO

       

      import oracle.apps.scm.doo.common.extensions.ValidationException;    // import the pkgs that standard classes belong to.                            

      def customerPONumber = header.getAttribute("CustomerPONumber");
      if( !customerPONumber.startsWith("EDI") ) return;

      def OrderSource = header.getAttribute("SourceTransactionSystem");
      //if(OrderSource != ("EDI") ) return;


      def ShipToSiteID = header.getAttribute("ShipToPartySiteIdentifier");
      def vo = context.getViewObject("oracle.apps.fnd.applcore.lookups.model.publicView.LookupPVO");
      def Lookup = "WD_EDI_RETAIL_SITES";
      def vc = vo.createViewCriteria();
      def vcrow = vc.createViewCriteriaRow();
      vcrow.setAttribute("LookupType", Lookup);
      vcrow.setAttribute("LookupCode", ShipToSiteID);
      vc.add(vcrow);
      def rowset = vo.findByViewCriteria(vc, 1);
      if(rowset.hasNext() )
        {throw new ValidationException("WD: Retail Orders are not in scope");}