Scheduled Job - Daily
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 10:57 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 11:49 AM
Got it. Thanks.
// Build the encoded query for customer_contact
var encodedQuery = "last_login_time<javascript: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 11:54 AM