function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
asonimieSFDCasonimieSFDC 

Automated report/campaign generation

Has anyone had experience with automated report generation to be used to automatically maintain campaigns?

 

I have a request to be able to 'preschedule' reports and have the report contacts be added to a campaign at a later date.  So for example, a report is built on Monday, but the customer wants the most recent data attached to the campaign (which is set to run on Friday).  So they want the report to be able to run and attach it's contacts to the campaign on Friday.  I know you can schedule future runs of reports, but that doesn't really schedule them for a specific day, and then also to handle adding the contacts to a campaign.

 

The other request is for a campaign list to be refreshed on it's own.  Is there a way to have to criteria of a campaign be known to the system so it can search all campaign members to make sure they still meet the criteria, and if not, remove them.  And also to be able to search for contacts who were not on the campaign but now meet the requirements and add them.

 

Has anyone done anything like this before?

sfdcfoxsfdcfox

The former isn't possible, as it only allows the report to be emailed.

 

The latter is possible, but you'd have to write a Schedulable class (Apex Code) that could periodically run against campaigns and remove or add members based on your criteria. It would also be a way to implement the first request.

asonimieSFDCasonimieSFDC

For the former, is there a solution outside of the schedule future runs that would make it possible?

 

Sorry I just reread your first post.  So this would be able to be achevied through the schedulable class?

 

Can the criteria that gets passed to the class be different for every campaign?

sfdcfoxsfdcfox

Yes, the schedulable class is the most appropriate method. Other methods that are possible all exist outside the system (custom integrations that require separate hosting in your network). The criteria can be customized by passing a parameter to the schedulable class when it is created. There's an example of this inside the developer documentation. You might also need to create some additional supporting code, such as a Visualforce page and a controller for the page.