• Josh Duer
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi, 

I recently made a minor change to an older Apex Class - essentially I updated a query to exclude certain picklist values (added set and excluded in query):
Set<String> ExcludedVerticals = new Set<String>{'Vertical1', 'Vertical2'};//sets verticals to be excluded from NPS surveys
        Set<ID> accountIdsToSendEmailTo = new Set<ID>();
        for(Contract ctrct: [Select ID, AccountID, Subscription_Start_Date__c
                             from Contract 
                             where AccountID in: accountIDs
                             and Contract_Status__c =: 'Active'
                             and Subscription_Start_Date__c !=: null
                             and Account.Vertical__c not in: ExcludedVerticals])
This class sends out NPS survey based on contract information. In order for me to save this on Sandbox I had to delete the existing scheduled job. 

My questions is how do I recreate the scheduled job to execute the class? I know it's not as important on Sandbox, but I'd like to know the exact process in preperation for moving to production. 

I'll also add that I'm not very experienced in development, but slowly making by way through small projects like this so any and all help would be appreciated!

We do have existing Test and Schedule classes that reference the class I edited. 

Thanks, 
Michael 
Hi, 

I recently made a minor change to an older Apex Class - essentially I updated a query to exclude certain picklist values (added set and excluded in query):
Set<String> ExcludedVerticals = new Set<String>{'Vertical1', 'Vertical2'};//sets verticals to be excluded from NPS surveys
        Set<ID> accountIdsToSendEmailTo = new Set<ID>();
        for(Contract ctrct: [Select ID, AccountID, Subscription_Start_Date__c
                             from Contract 
                             where AccountID in: accountIDs
                             and Contract_Status__c =: 'Active'
                             and Subscription_Start_Date__c !=: null
                             and Account.Vertical__c not in: ExcludedVerticals])
This class sends out NPS survey based on contract information. In order for me to save this on Sandbox I had to delete the existing scheduled job. 

My questions is how do I recreate the scheduled job to execute the class? I know it's not as important on Sandbox, but I'd like to know the exact process in preperation for moving to production. 

I'll also add that I'm not very experienced in development, but slowly making by way through small projects like this so any and all help would be appreciated!

We do have existing Test and Schedule classes that reference the class I edited. 

Thanks, 
Michael