Fix script error - 'maximum execution time exceeded'

Suggy
Giga Sage

Hello, I am running a fix script which will update the few fields on a table.

After 180s, I got this message. I see that around 1500 records got updated and the script had to update around 2k more records but then got this message.

 

Suggy_0-1711301639720.png

Below is the script:

var rec = new GlideRecord('u_tableau'); 

rec.addEncodedQuery("sys_domain=f5b0bd2800e34444d9a15f45c6cfg466");

rec.query(); 

 while(rec.next()) {           

   rec.setWorkflow(false);

   rec.setValue('short_description','Deactivating as per G12 policy');

  rec.setValue('u_str1','Approved');

   rec.setValue('u_str2', 'Deactivated')

  rec.setValue('active','false');

   rec.update();

 

I checked in Transactio quota rules, its set to 4 hours.

Suggy_2-1711301692629.png

 

What could be the issue?

 

9 REPLIES 9

swathisarang98
Giga Sage
Giga Sage

Hi @Suggy ,

 

could you please share the script ? and if you are running for large number of data, try running it in Proceed in background.If this also doesn't work try running it in schedule job and also if there any possibility try adding more filter in query .

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Hi There, thanks for replying. I cannot share the script. Its a simple script to set value to a field.

Yes, I know that I can run in background script/scheduled job, but all that I wanted to know why Fix script is failing? Where is that time restriction done?

Hi, if a fix script fails, it will usually be failing as a result of the script that is being run, this could be anything from code syntax to scoping issue; Unfortunately, if you are unable to share your script then there is no way that the community can constructively evaluate it and advise of potential issues.
Perhaps you could share the script in plain text, so that the community can review? 

Hi @Tony Chatfield1 udpated my question 🙂