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

DrewW
Mega Sage
Mega Sage

The only option I can think of off the top of my head is to use the sysIDs to make a call to the server from the client to see if its the task you are talking about and if it is do not allow the edit.

Another option maybe to use a business rule to do this but not sure you would be able to accurately determine the edit is being done from the related list or not.

Why is it you do not want them to list edit for the one task?  What is the reason behind that?

 

I have created a mandatory variable in that specific task, which if closed on the RITM view, it will go unpopulated. This variable is only mandatory in this specific catalog task. So, it's made mandatory using a client script, not a UI policy.

I had also tried creating a business rule and using this statement in the client script, This didn't work at all....

 

if (((newValue == 3) || (newValue == 4) ||  (newValue == 7))  &&   (g_scratchpad.wf_activity == 'NetworkOp Task')) 

Ok so that gives us an option.  Create a business rule to check for the condition you are talking about.  Check the wf_activity field of the cat task and if its the right one then check the variables to make sure the one you need is populated and if not abort the update.  Just make sure that the cat task is not being closed because the requested item is being cancelled.

Last you have to translate that IF statement into something that is server side, you cannot just cut and paste client code and have it work.

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.