Modifying Sales Order Line items via SDK

Overview

This article provides a workaround for customers looking to modify, add or re-order Sales Order line items through the Everest SDK (Software Development Kit). 

 

Information

To further enhance the power of Everest, Everest Software provides an Everest Software Development Kit (SDK) to supports the development of custom-fit, practical solutions without requiring in-depth knowledge of Everest’s architecture.

The SDK does not provide a direct way to insert and re-order Sales Order line items but this can be done through customizing the relevant Sales Order XML file.

Note: The steps below should be done by a user with Super User privileges and assume that the customer environment already has the Everest API installed.

This requirement can be achieved by adding and modifying the sequence of the Sales Order items as shown in the following example:

  1. The initial state of the Sales Order is as shown in the attached screenshot and we would need to add a new item on line 2. 
    Sales_Order_Items.png

  2. First, we add the item, using the eoSalesDocument.addLineItem, using the XML given below.
    <?xml version='1.0' encoding='utf-8' ?>
    <LineItemSalesDocument>
    <DocumentNo>200228</DocumentNo>
    <LineItems>
    <LineItem>
    <ItemCode>4453</ItemCode>
    <Description>1994 Pessac-Leognan Blanc</Description>
    <Quantity>1</Quantity>
    <ItemPrice>119</ItemPrice>
    <UOMCode>EA</UOMCode>
    </LineItem>
    </LineItems>
    </LineItemSalesDocument>
  3. Using eoSalesDocument.Retrieve, we retrieve the line items
  4. Take all elements under <LineItems> from the retrieved line items and remove all fields that contain "ReadOnly" attributes
  5. Since the sample is using the tax calculation method as automatic, we need to remove the <TaxCode> entry. See Adding_line_item.xml 
  6. Modify the value in the field Sequence to move the last entry, newly added line item on step 2, to the intended position, and update the sequence field afterward as the next sequence. See Updating_the_sequence.xml 
  7. Using the modified XML, call eoSalesDocument.ModifyLineItems. This new line item should be added in the desired position as configured:
    Modified_Saled_Order_Items.png

Refer to Working with the Everest API for more information on working with the Everest SDK and API.

​Back to top

Attachments

Comments

0 comments

Please sign in to leave a comment.