<!here|@here> Hi guys is it possible to lock the t...
# suitescript
s
<!here|@here> Hi guys is it possible to lock the transaction (PO) lines after it has been approved via client script? It is already locked after approval with certain role based exceptions via workflow, these roles can edit the transaction. What I am looking for is to keep the edit option open for the header part not the line level via script. Any suggestions appreciated 😅
s
yes you'll just want to disable the fields in each line
sorry, to be more specific there's no netsuite api for it but you can do it through the dom
something like fld = getFormElement(document.forms["item_form"],getFieldName(fieldId));
disableField(fld,true);
t
do you know of a way to do this so that if in the future new fields are created you do not have to modify the script?
s
you could pass the fields that you want locked in as a parameter for the client script then just add them there when you add a field. then your script would just have to iterate through each one.
@tjaffer We have also utilized your method in instances to lock down the entire line. The method that I mention here is useful if you're not locking all columns in the list.
z
Little late on this one, but why not just a validate line script that looks to see if the order is approved and if it is, then return false?
s
thanks guys at least now I got some idea on how to tackle this.