Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

@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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
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  ||  10x 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