Scheduled Job - Daily

MStritt
Tera Guru

I'd like to run a scheduled job that runs nightly, that will look at all Contacts (customer_contact). The Contact will be deactivated (Active = false) if the following conditions are true. Below is the URL of the Conditions/query. I'll need help with sample code/script to use.

 

customer_contact_list.do%3Fsysparm_query%3Dlast_login_time%253Cjavascript%3Ags.beginningOfOneYearAgo()%255Eaccount!%253D58ba9ccb4fddb640873b69d18110c744%26sysparm_first_row%3D1%26sysparm_view%3Dcase

6 REPLIES 6

Got it. Thanks.

 

// Build the encoded query for customer_contact
var encodedQuery = "last_login_time<javascript&colon;gs.beginningOfOneYearAgo()^account!=58ba9ccb4fddb640873b69d18110c744";    //add your query in this line by copying from list view of contacts table

 

This is the only thing I need to add, correct? I don't need to make any changes/updates to:

// Query the customer_contact table based on the encoded query
// Loop through the contacts and deactivate them

 

 

Manmohan K
Tera Sage

@MStritt 

 

Yes, this is how your script should look like

 

ManmohanK_0-1689015272965.png