top of page

Tags

Archive

Using OM Extensions to Manipulate the defaulted values in OM Cloud

Writer's picture: SatyaSatya

Updated: Aug 15, 2020

In Fusion Applications, you can Manipulate a defaulted value with a custom value. In this Post i will explain a use case and the solution provided using OM Extensions .



Requirement: Business wanted to Overwrite the Defaulted values for the fields customer contact from header and shipment levels. In general, This cannot be achieved through personalization or customization as this has to be an event based manipulation at the run time.



Solution : We can create an OM Extension which in turn calls a groovy Script. See the screenshots below.



Sample Script:



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


String headerId = header.getAttribute("HeaderId").toString(); String sourceOrderId = header.getAttribute("SourceTransactionIdentifier");


def bpId = header.getAttribute("BuyingPartyIdentifier"); def bpcId = header.getAttribute("BuyingPartyContactId"); //def bpcpId = header.getAttribute("SoldToPartyContactPointId"); //def bppcpId = header.getAttribute("PreferredSoldToContactPointIdentifier");


header.setAttribute("BuyingPartyContactId", null); header.setAttribute("SoldToPartyContactPointId", null); header.setAttribute("PreferredSoldToContactPointIdentifier", null);


def stpId = header.getAttribute("ShipToPartyIdentifier"); def stpcId = header.getAttribute("ShipToPartyContactIdentifier"); //def stppcpId = header.getAttribute("PreferredShipToContactPointIdentifier");


header.setAttribute("ShipToPartyContactIdentifier", null); header.setAttribute("PreferredShipToContactPointIdentifier", null);


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


if(!lines.hasNext()){ throw new ValidationException("More time is needed to process the order"); }


while (lines.hasNext()) { def line = lines.next(); stpId = line.getAttribute("ShipToPartyIdentifier"); stpcId = line.getAttribute("ShipToPartyContactIdentifier"); //stppcpId = line.getAttribute("PreferredShipToContactPointIdentifier");


line.setAttribute("ShipToPartyContactIdentifier", null); line.setAttribute("PreferredShipToContactPointIdentifier", null);


}





Image1: The above Groovy Script is added in the created OM extension.






Image2: You can see that the extension will trigger on start of submission request. Which means after the order is created and when the submit button is clicked this extension will trigger.




Image3: While creating an order , The customer contact is defaulted based on the defaulting rules.




Image4: After clicking on submit , The same is nullified from both header and line shipment level !






Hope this helps!

Please leave your questions in the comments



291 views0 comments

Recent Posts

See All

Comments


Other Posts you may Interested 

Subscribe Form

  • facebook
  • linkedin
bottom of page