How to set the default field Value but allow user to edit using workflow

How to set the default field Value but allow user to edit using workflow


Requirement: Set the default field value using a workflow, but allow the user to override the value on the UI.

This is a very common requirement from a client to set some default values to a field in NetSuite but client also wants it to be editable. I know this is possible to do with SuiteScript but can we do the same using a workflow? In this post, I will create a workflow that can do the same on the sales order record for the memo field.

Create a workflow by going to customization -> workflow -> workflows -> new

Set the workflow name and select transaction type as sales order

Edit the workflow and select new action as set field value

Select the following:

Trigger on "After Submit"

Event type: "Create and Edit"

Leave context as default

We will now set the condition for Field "Memo" and set the compare type to empty. Please see the below image for reference.

Now scroll down and select the field Memo, set the value to "This is a default value," and click save.

Our server trigger is ready.

Now we need to work on client triggers.

Click the new action and select the set field value again.

Select the following value:

Trigger on : Before User edit (when page loads in the browser, set some default value)

Condition: none; we will not select any condition here.

Scroll down and select field Memo and value as "This is a default value".

Click save.

This is what the final state 1 should look like:

Our workflow is ready. Let's test this:

The Memo field is setting the value to "This is a default value."

Now we shall test using some different values.

As we can see, we are able to change the default value on the UI as well. This completes our workflow.

Did you find this article valuable?

Support Anurag Kumar by becoming a sponsor. Any amount is appreciated!