In this scenario the business requirement is to remove any attachment in the CRM system if it is older than 3 years.
N52 Formula Manager Solution
The Formula Manager 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
N52 Formula Manager 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') )
Did you know?
You can Connect to 1000s of Web Services as part of your Decision Logic
When your advanced business rules and complex logic requries that you integrate with other systems North52's Web Fusion functionality can help. It enables two-way data communication between your Dynamics 365/CRM system and another service or application.