Close Catalog Task

abhiyadav2001
Giga Expert

Hi,

 

I tried closing task from UI button as follows

 

task.state = 3;

task.close_notes ='Request has been completed';

task.update();

 

I tried using 'current' as well.. but results in no change.

 

However, its not updating the task.

 

What am I missing here ?

 

Thanks,

Abhijeet

1 ACCEPTED SOLUTION

Oh yes it shouldn't be client callable it should just run server side, uncheck that.


View solution in original post

9 REPLIES 9

Oh yes it shouldn't be client callable it should just run server side, uncheck that.


Hi,



It worked for me !   Thank you very much mguy and Kalai 🙂



regards,


Abhijeet


Kalaiarasan Pus
Giga Sage

'task.' works in workflow only.... it could work in 'script include' if it is getting called through workflow....



use 'current.' and it should work


Kalaiarasan Pus
Giga Sage

this is a classic rookie mistake


this question crops up now and then, very frequently of using server side and client code in a ui action



this should help


http://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/



I guess service-now wiki should write a article on this


Atleast I feel this is very frequently asked


Kalaiarasan Pus
Giga Sage

mark the question as answered and close the loop off