NetSuite SuiteTalk User & Role Edits Are Delayed

If you work with NetSuite’s SuiteTalk API, you know that:

You must access the API via employee/user record in NetSuite API calls specify the user role to use You will get different results based on which user and which user role you are accessing the API with. For instance, if the employee record has the “Sales Rep” option checked, all Sales Orders created using that employee/user credentials will have the “Sales Rep” field assigned to the user’s record. Each role has a different set of permissions. You will get different fatal error messages depending on which user role you are operating under.

Often, when developing a NetSuite integration, you’ll need to make edits to the SuiteTalk user/employee record or the role.

Changes to the role or user do not take effect immediately. They can take anywhere from a couple minutes to a couple hours to take effect. This destroys the developer feedback loop and makes it exponentially harder to track down the source of specific NetSuite SuiteTalk errors.

This means that if you make a change in your sandbox or production account relating to either employee or user records there is no way to know if the change fixed the issue you were debugging aside from waiting a couple hours and retrying the operation.

Often, what I’ve done, is write a failing feature test for my NetSuite integration issue I’m encountering and then rerun the test in the morning after making user or role tweaks.

If you have access to the private NetSuite forums, you can read this post for more information.

Continue Reading

Split Shipment Fulfillment with NetSuite

NetSuite natively supports partially fulfilling a SalesOrder. However, updating an ItemFulfillment record (NetSuite’s equivalent to a ‘package’ or ‘shipment’ in other systems nomenclature) after it’s been created comes with some unique edge cases in NetSuite.

Here’s the NetSuite state that I was operating in:

Sales Order is created. order_status = _partiallyFulfilled An ItemFulfillment exists with ship_status = _picked A CustomerDeposit representing the payment coming from an external system is associated with the SalesOrder The contents of the created ItemFulfillment need to be adjusted and a second ItemFulfillment needs to be created.

Here is some key information on how NetSuite’s ItemFulfillments work:

The order_line field is not set on an ItemFulfillments item list elements if the item is a “member” of another item in the item list. In other words, if you are fulfilling a KitItem or AssemblyItem the components of those items will appear on the ItemFulfillment’s item list but will not have a key (unique ID to reference them on the sub lisT) and thus cannot be updated. The item_receive flag is equivalent to the “Fulfill” column in the GUI. The replace_all flag on item_list must be set to false when updating an item list containing KitItems or AssemblyItems. Also, all items without an order line must be removed from the item_list. If they are not removed, the following fatal error will be thrown: “Adding new line to sublist item is not allowed.”

Using the NetSuite SuiteTalk ruby gem, here’s how to remove items from an existing ItemFulfillment:

item_fulfillment.item_list.item.each do |i| i.item_receive = false i.quantity = 0 end item_fulfillment.item_list.replace_all = false item_fulfillment.item_list.items.reject! { |i| i.order_line.blank? } item_fulfillment.update(item_list: item_fulfillment.item_list)

Continue Reading