RE: Popup message on sales order when certain item added

I am want to create a popup message/alert when certain items are added to a sales order.

This can be immediately after the item is added or upon saving the record. I have tried via workflow but it does not seem that Show Message action is available for line items?

Margie Beginner Asked on September 17, 2020 in How To's.
Add Comment
3 Answers

Are there many “product As” or is it a case or two? Have you tried using item groups? Or a promotion that adds it automatically?
Also I can think of a client script or try the “items on order” field under the conditions for a workflow.
Happy to help out if you send over more details.

Beginner Answered on September 17, 2020.

I was thinking something like the “items on order” criteria too, but I just looked and I don’t see any such field in the workflow criteria. I’ve used “item on any line” in a saved search before but don’t see that in there either.

on September 18, 2020.

There is about 30 SKU’s that this applies to. Item groups or promotion is not really applicable as it is not applicable in 100% of the time so I was just wanting a message to remind the user to check if applicable or not. I can’d see the items on order condition for workflow. Can you help as to how to achieve this via client script.

on October 18, 2020.

Margie, sorry I saw this message just now. Through client script I can think of something like this:


* @NApiVersion 2.x

* @NScriptType ClientScript


* @author Mercedes Lerena






function process(


) {
function validateLine(context) {
var soRecord = context.currentRecord;

var list = context.sublistId === 'items';

var itemsArray = [123, 124, 125];

var currentItem;
if (list) {
currentItem = soRecord.getCurrentSublistValue({

sublistId: 'items',

fieldId: 'item'

if (itemsArray.indexOf(currentItem) !== -1) {


title: 'Question?',

message: 'Please confirm this and that.'




function success() {

// Something to do if pressed OK

function failure() {

// Something to do if function success had errors

return {

validateLine: validateLine



I did not try this before sending, if you need extra help, don’t hesitate in contacting me directly.

on November 2, 2020.



I have tried your script but I am getting the following when I try to upload it:

Fail to evaluate script: {“type”:”error.SuiteScriptModuleLoaderError”,”name”:”UNEXPECTED_ERROR”,”message”:”missing ] after element list (SS_SCRIPT_FOR_METADATA#17)”,”stack”:[]}


I have not added any code for the success and failure functions. I just want the popup to work as a reminder.

Do you think you can help me out?


on July 18, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.