In this scenario the business requirement is to remove any attachment in the CRM system if it is older than 3 years.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- We create a formula of type 'Process Genie' so that it can be called from a workflow
- A workflow is created that calls the 'Process Genie formula '
- A schedule is setup to run nightly that finds all attachments older than 3 years
- When the schedule executes it find all the attachments & calls the workflow which in turn calls the formula to delete the attachment
North52 Decision Suite Steps
The following set of steps will set this formula up for you,
- Create a new formula of type 'Process Genie'
- Set the Source Entity to 'Notes'
- Copy & paste the formula below into the formula description field
- Click Save
- Make a note of the formula short code in the top right hand corner of the formula. In this case 'EGR'
- Create a new workflow based on the screenshot above
- Add the custom workflow activity named 'North52 Process Genie'
- Set the formula short code to EGR
- You are ready now to test
- Use the advanced find as shown below & download the fetch xml
- Create a new schedule
- Set it to execute each night at 2am
- Set the workflow to be the one named 'Remove Attachments
- Paste the fetch xml into the query field
- Click Save
- Start the schedule
UpdateRecord('annotation', [annotation.annoationid], SetAttribute('documentbody', '?'), SetAttribute('filename', '?'), SetAttribute('filesize', '?'), SetAttribute('isdocument', 'false') )