Script in UI Action always throws a error in the first line

Kumar38
Kilo Sage

I am creating a simple ui action in a scoped application, even before I enter any code , line one shows red '~'.

after entering the code, when I look at the view problem , it shows the below 3

 

1. Definition for rule 'sn-no-async-await' was not found.

2.Definition for rule 'sn-no-generator-functions' was not found.

2. Definition for rule 'sn-no-promises' was not found.

 

Here is script :

 

current.status == 'In_progress';
current.update();
action.setRedirectURL(current);
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Kumar38 

it should be single = and not ==

current.status = 'In_progress';
current.update();
action.setRedirectURL(current)

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Kumar38 

it should be single = and not ==

current.status = 'In_progress';
current.update();
action.setRedirectURL(current)

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Not sure how I missed it , it still shows the red symbol on new scripts without any code. However its working fine now.

Hi Ankur,

I am still facing the error and state is also not updating could you please