OnCelledit client script question

Dom G
Tera Expert

I'm using this OnCellEdit client script to restrict changing the state to "close" of a Catalog Task from RITM view and it's working. Whenever one attempts to change the state of any catalog task, from the RITM view, an alert is generated, "Not allowed".  The issue is that it works for all catalog tasks. I want it to work for only a particular catalog task in the workflow. We'll call that catalog task "NetworkOp Task".

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Dom,

 

Unsure about the need for onCellEdit but suggestion would be to go with an before update business rule on Catalog task table where you can check for Item & then abort the action by displaying error message instead of alert.

This would not inovlve any coding as well. Something as below.

1. Business rule Replace your catalog item accordingly. Not item field is dot-walked from Request item table.

find_real_file.png

find_real_file.png

 

Since, its business rule it would work regardless of state being changed from List or Form or anyother view.

View solution in original post

8 REPLIES 8

Thank you the suggestion.

 

I need to abort the cell edit not just for a specific catalog item. I need to abort it for a specific "catalog task" in a specific "catalog item".

Ankur Bawiskar
Tera Patron
Tera Patron

@Dom G 

You cannot access the field value using g_form object in onCell Edit so as suggested by Jaspal you should use before update business rule

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Pranesh072
Mega Sage
Mega Sage

It is better to use ACL for restriction

That can work but most server side code will by pass the ACL's so it will depend on what needs to be prevented and when.