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).
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.
This requirement can be achieved by adding and modifying the sequence of the Sales Order items as shown in the following example:
- 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.
- First, we add the item, using the eoSalesDocument.addLineItem, using the XML given below.
<?xml version='1.0' encoding='utf-8' ?>
<Description>1994 Pessac-Leognan Blanc</Description>
- Using eoSalesDocument.Retrieve, we retrieve the line items
- Take all elements under
<LineItems>from the retrieved line items and remove all fields that contain "ReadOnly" attributes
- Since the sample is using the tax calculation method as automatic, we need to remove the
<TaxCode>entry. See Adding_line_item.xml
- 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
- Using the modified XML, call eoSalesDocument.ModifyLineItems. This new line item should be added in the desired position as configured:
Refer to Working with the Everest API for more information on working with the Everest SDK and API.
Please sign in to leave a comment.