You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Sales Order Header Level Hold using Extension

Received Response
211
Views
10
Comments

Summary:

Hi,

Looking for some help on groovy script to apply Sales order Header HOLD.


I see the below script, but that is to apply at Line level. Appreciate if someone can share HEADER level HOLD code. Thank you!



************************************************************************************

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

while (lines.hasNext()) {
  def line = lines.next();

  // Make sure the ordered quantity is greater than 10.
  BigDecimal qty = line.getAttribute("OrderedQuantity");
  if (qty.compareTo(new BigDecimal(10)) > 0) {
    if (canApplyHold(line, "DOO_RSRV")) {
      debug("Applying hold");
      def hold = line.applyHold("DOO_RSRV"); // Create a hold and use the DOO_RSRV hold code.
      // Display text that explains what we're doing.
      hold.setAttribute("HoldComments", "We're holding this line so we can manually review and approve it.");
  

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!