Running a Business Rule from an Scheduled job

jtorres
Kilo Contributor

Hello everyone.

I have a Business Rule, and I want to run it periodically, to validate an expiration date on a record, the BR works properly, but because of the nature of BRs I have to either update or insert the form, for it to trigger, I read that we could run it from an scheduled job, but I haven't found the way to set the relation between them.

var now = gs.endOfYesterday();

var vigencia = current.u_fecha_fin; //expiration dateif(vigencia < now){

current.u_hrs_vencidas = current.u_hrs_restantes;

current.u_hrs_restantes = 0;

current.u_activo = 'true';

gs.addInfoMessage("TEST");

}

Could anyone please help me find the best way to do this?

Thanks in advance and regards!.

1 ACCEPTED SOLUTION

crhistopherjuar
Kilo Expert

Hi Irving,


I recommend to you, this app developed by Chui Tomasi.



ServiceNow Share


Scriptless Scheduled Jobs - YouTube



P.S. Please hit like, helpful or correct for my responses as they apply to you


View solution in original post

15 REPLIES 15

Hey @crhistopherjuar ,

 

Thanks for this solution provided but it's @Chuck Tomasi , not Chui Tomasi.😄😆🙂.

Hope so you don't mind it.😜

 

And I have already marked your answer as helpful ðŸ¤—.

 

 

 

 

@Chuck Tomasi ðŸ¤˜ChuckChuck