Scheduled Jobs

Phani Pasupulet
Tera Contributor

I have a custom table with these records

PhaniPasupulet_0-1690560617016.png

 

I wrote a scheduled job to update the d field in my custom table

PhaniPasupulet_1-1690560779991.png

Every thing is perfect why scheduled job is not applied to my custom table 
i can able to do it on incident table but 
why I am not able to apply it to my custom table
Can anyone please help
(I want to add d value when s value starts with hii)

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @Phani Pasupulet,

 

Make sure that the table name and field name in GlideRecord used are  correct.

Have you executed the scheduled job manually by click Execute now button?

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

View solution in original post

5 REPLIES 5

Sethu Varma
Tera Expert

Hi @Phani Pasupulet,

 

Did you check by clicking on Execute now.

 

 var cust_tb = new GlideRecord('u_tb');
cust_tb.addEncodedQuery('u_dSTARTSWITHhii');
cust_tb.query();
 
while(cust_tb.next()){
cust_tb.u_s='Test';
cust_tb.update();
}
 
Update the field backend names based on your table. 
 
It worked for me with that script and updating s value once I click on the execute now button.
 
Thanks,
Sethu