How to run a schedule job when a user log in the instance? What should be the condition

Rosy14
Tera Guru
 
5 REPLIES 5

dpac_nick
Tera Contributor

If requirement is to execute some script when user logs in, there is an oob event "login" which is fired when user logs in it can be associated with script action to execute the script.

https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/platform-eve... 

If this works for you, please mark my answer correct or helpful.

Mark Manders
Mega Patron

Why do you want to run a scheduled job when a user logs in to the instance? That could cause huge performance issues. 

The last login on the user record changes when a user logs in, so maybe you can use that, but I would really look at your requirement and the reason you are going for this solution and just shoot it down if there is no other way to resolve it.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I want to set a field value based on user. There are table where for all records i want to set. How to achived it?

I gave you a possible trigger, but again: don't do this. It will cause you performance issues.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark