Location Validation In Purchase Order

Location Validation In Purchase Order

Proposal summary

Setting location for each line item defaults to the location chosen in the Classification section of the purchase order form.

Requirement 

Would you be able to do one of two things on our PO transaction form? 

Either, have the location for each line item default to the location chosen in the Classification section of the form.And/or, make the location for each line item mandatory.

Deliverables

Set the line locations the same as the body level location when the body level location is selected.

Our Solution

Solution 1

Real time scenario. 

The location change is reflected in the real time in line level, when the user selects a new item in the netsuite or updating body level location in the Netsuite. 

We will consider 2 different scenarios for achieving this line level location customization. Users must choose body level location before entering the items in purchase order.

Scenario 1

If body level field given before adding items in the item line.

  1. When a user adds a new line item to the item sublist.
  2. We will fetch the body level location and set it to the line location.

Scenario 2

If body level field given after adding the items in item level.

  1. When a user changes the body level location field value. We will populate the body level location in each line level.
  2. We will override all the line level locations without considering the location in the line level.

Note:

  1. Script will affect the performance of the purchase order record.
  2. Does not support the make a copy scenario.

Solution 2

This method does not show the location population in real-time, only reflects the line-level location after saving the purchase order record.

The users no need to enter the location value inline-level, Using this method we populate the location in the purchase order line after saving the purchase order record based on the body level location value.

  1. For achieving this we will write a user event script after submitting context.
  2. On save button action we will iterate each item line. 
  3. If the line item has no location we will set body level location into the line location.
  4. If line-level location exists. We will consider the user manually added this location for their receiving purpose. We won’t override this location.

Note:

  1. The location does not change in real-time (When a user adds an item.)
  2. Only line-level location populated on save button action.
  3. This method does not have any performance issues.
  4. This script works in all contexts. Create/edit purchase order, also in a make a copy context.

Leave a comment

Your email address will not be published. Required fields are marked *