Lock Record w/ SuiteScript

Is there a way to lock records with SuiteScript like you can with a workflow?

Beginner Asked on January 28, 2020 in SuiteScript.
Add Comment
2 Answer(s)

Record locking is not supported in suitescript. You can try creating a workflow instead. You can try using N/workflow to trigger workflows if you really wanted to be suitescript driven.

Advanced Answered on January 28, 2020.

Got it. Thanks!

on January 28, 2020.

I think I like this approach better than my own

on January 28, 2020.
Add Comment

No. You have 2 options really

  1. Conditionally lock your record using a workflow but drive the logic using suitescript (i.e. checkbox drives workflow and is set by suitescript)
  2. Check every field updated in a UE using the newRecord object and comparing it with the oldRecord value.If you only care about a few values not changing this is maybe a solution. Keep in mind this will be hard to use for all contexts as xedits and csv’s that run without scripts enabled would easily get past this
Beginner Answered on January 28, 2020.

Ok. So it sounds like there is no blanket action to lock the whole record like a workflow, which is the conclusion I came to. I wanted to stay in SuiteScript for this solution, but it might be worth just making a quick workflow for this part. Thanks!

on January 28, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor