Netsuite Tutorials: Difference Between User Event and workflow in Netsuite?

Workflow Vs User Event , Client Script and Schedule Script
Workflow Vs User Event , Client Script and Schedule Script




Hi All,

This is a very common question, What is difference between User Event and Workflow?
Even we can use workflow as scheduled or as a client function also.

Similarities between Workflow and User Event Scripts:

 1. Both Need trigger point like on create, copy or edit etc .

 2. We can add condition in both workflow and User Event scripts.

 3. We can set Context in workflow as well as User Events.

 4. We can set for which role Workflow or User Event can run.

 5. We can set new Field, or make field mandatory or throwing error messages.

 6. Workflow can work on if value of record gets changed, like old record's value and new record's value .

 7. Saved Searches can be used in Workflow as well as User Event .

 8. We can create Record using workflow as well as User Event also.

 9. We can add button same way as we do in user event.

10. We can send Email using both workflow as well as User Events.

11. We can change field Label , display type, remove button etc


Similarities between Workflow and Client Script: 

  1.Workflow as well as Client script both can set field value on change of any field.

  2. We can go to any record or page using Workflow as well as Client scripts.

  3. We can change display type of fields in workflow as well as client scripts.

  4. We can add validation in workflow as well as Client Scripts .


 Similarities between Workflow and  Schedule Scripts:

  1. We can send email as per schedule using Workflow as well as Schedule Scripts.

  2. We can update records as per schedule using workflow as well as Schedule Scripts.


Now comes a question, With so many similarities why we still use scripting for doing things which workflows can do easily.


What Workflow Can not do?

   Workflow is one of the best functionality provided by Netsuite to user to do things easily. Although it do things easily but it is very limited.below are some limitation which workflow is limited:

 1. If logic is complex and required multi level condition.

 2. If you want to access line items using workflows. With New Release (2018.1.0)  you can access Sublist too in workflow using "Sublist Action Group".

 3. If you want to access record which have no relation with current record.

 4. If you are building something out of  box.

 5. Some times Old values and New Values are same when you have your logic in workflow, which cause issue as both value is same.

 6. If you want to you company preference parameter of any other script.

 7. if you want to make sure one script should work after another, as we can set sequence using Scripted record for Scripts but we can not do same for Workflows.

 8. if we want to see debug where it fails, workflow only show debug if it gets executed, you can not add your custom debugs to see more.



How to overcome these limitations?

  Netsuite provide one more type of script called workflow action script, this script work like action of state

in workflow, you can add you logic inside custom workflow action script and it will do work for you.

Mostly it will become like a combination of workflow and user event.


Should we use Workflow and Workflow Action Script or User Event Scripts?

   It totally depends upon the requirements of the project/task, like if there is a requirement where you are

getting all values from records or somewhere from other record inside Netsuite dynamically , it is better to use User Events.

   If project requires some kind of hard coded value then it is better to use workflow plus workflow action

 script, there is a reason for doing this, if a person write something hard coded inside script then it will be

very hard for functional people or person who don't have technical knowledge to find it and fix it, Many

people don't know how to see id of record or list in Netsuite and what is the reason to set it.

On other hand if you created workflow and create parameter under custom workflow action script then any

one can update workflow Action and there will be no disturbance in you code. One obvious thing you have

to do is to validate if they added what ever was required or any garbage value, so write Debug for that and

return if garbage value. This way they will be aware of that some is wrong in new value, also if you

provided a way to find correct value they might find value and set in workflow.

Please comment below if you have any suggestion or any question.


Thanks
Abhi




Comments

  1. Super Abhi,

    You gave more clarity on Scripts.Its Awesome work.
    Please give some complex scenarios.

    ReplyDelete
    Replies
    1. sure Venkat,
      Don't forget to download our android app.

      Delete

Post a Comment

Thanks for you message, please join us on Facebook and Linkedin