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

Since you have not posted the scheduled job, it will be hard for anyone here to provide assistance. You also need to post some details on "sets a flag".

gnewuser
Tera Contributor

Thanks @Bert_c1  I added the code now

Is 'u_notices_date' defined as a Date field? and how is 'u_final_notice_set' defined. you have string values for 'true' in you code.

gnewuser
Tera Contributor

u_final_notice_set is defined as string and yes u_notices_date is date. Because the above code is senidng email but just not setting the flag to true