ANS-1476 · CUSTOM FIELDS, RECORDS & FORMS
NetSuite Workflow: Pop-Up Alert for Sales Order Shipping Cost Discrepancy
Implement a NetSuite workflow to notify users when the shipping cost on an invoice is lower than the associated sales order, preventing revenue loss.
Short answer
To alert users when Sales Order shipping costs exceed Invoice shipping costs, create a NetSuite workflow on the Invoice record. Utilize two custom transaction body fields to capture and compare shipping costs, then trigger a client-side 'Show Message' action with a custom formula to display a pop-up warning.
Scenario
Employees frequently adjust the shipping cost on item fulfillments to a rate lower than that specified on the customer-approved sales order, leading to potential revenue loss. While legitimate reasons for such adjustments may exist, these discrepancies are often due to errors, impacting job profitability.
Solution
Initial attempts to use workflow fields and the 'Show Message' action did not execute as expected when conditions were tested. Using the Visual Builder for conditions also did not trigger the action. The 'Return User Error' action, when set with a 'Before Record Submit' trigger, executed but displayed the message on a new page rather than as a desired pop-up. The 'Show Message' action is specifically designed for client-side events and triggers, which occur on the browser. Workflow fields in this context were initially considered server-side fields. The 'Before User Submit' trigger is a client-side trigger. When comparing currency fields, it is necessary to convert them to an integer using parseInt().
To implement this solution, follow these steps:nn
Create Two Custom Transaction Body Fields.
Navigate to Customization > List/Records/Fields > Transaction Body Fields > New.
Field #1 - Captures SO Shipping Costn* Label: SO Shipping Cost (Workflow)n* Type: Currencyn* Applies to: Salen* Display Type: Inline Text
Field #2 - Captures Invoice Shipping Costn* Label: Invoice Shipping Cost (Workflow)n* Type: Currencyn* Applies to: Salen* Display Type: Inline Textnn
Create Workflow.
Navigate to: Customization > Workflow > New.
Workflow Definitionn* Name: Invoice Shipping Cost Alertn* Record Type: Transactionn* Sub Types: Invoicen* Event Definition On Create
Define State 1 - Invoice Alert
Action #1 - Set Field Valuen* Trigger On: Entryn* Field: SO Shipping Cost (Workflow)n* Formula:n
n{createdfrom.shippingcost}nAction #2 - Set Field Valuen* Trigger On: Before User Submitn* Field: Invoice Shipping Cost (Workflow)n* From Field = Tn* Record (Join Field) Current Recordn* Field: Shipping Cost
Action #3 - Show Messagen* Conditionn* Custom Formula:n
nparseInt({custbody_gs_so_ship_workflow})>parseInt({custbody_gs_inv_ship_cost_workflow})nn* Text: SO Shipping Cost > Invoice Shipping Cost
Important Note: The hierarchy of actions dictates that the 'Display Message' action should be the last in the sequence.
Expert NetSuite Support
Need help with this NetSuite issue?
Custom Fields, Records & Forms consulting and configuration support
