Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Custom app Question

gnewuser
Tera Contributor

I have a custom app which has a scheduled job that sends notification and sets a flag (set flag = true) value in the table inside the custom app. This works fine in dev and prod but not in prod. In prod, it sends the notification but not set the value of flag as true. 

 

What could be the reason?

 

1. I created a new job and copied the code but still only email get sent but not setting the value of flag

2. I checked the ACL of the table nothing drastically different between the prod and dev/test

 

     var today = new GlideDate();
  var gr = new GlideRecord("table name");
    gr.addQuery('u_notice_dates', today); // Add query to find records with notice date as today
    gr.query();
    while (gr.next()) {
		        if (gr.u_final_notice_sent != 'true') {
       	 gs.eventQueue("eventname", gr); //event that sends out notification
	  gr.u_final_notice_sent = 'true';
    // Update the record with the new flag value
    gr.update();
		    }
	}
 

 

 

 

 

What else could I be potentially missing?

 

 

5 REPLIES 5

Bert_c1
Kilo Patron

I guess you need to debug your script. Try:

 

 

  // Update the record with the new flag value
    var rslt = gr.update();
    gs.info('Record update = ' + rslt);

 

and then check Script Log Statements to see the result. You should see the sys_id of the record being updated.

 

Check access to the table from the custom app.