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
Inna ChigarevaInna Chigareva 

Include Notes&Attachments in the workflow

Hi,
I am trying to build a workflow, which would trigger when there is a new attachment uploaded to the record. One of the workflows example is to move Follow-up date (custom field) in Opportunity 2 weeks ahead once there has been a new attachment. 

Is it possible to build a code for that? 


Thanks,
Inna
NagaNaga (Salesforce Developers) 
Hi Inna,


If you want to report on Attachments, I would suggest placing an object in between Attachments and Opportunities. Here is what I mean:

1. Create an object called "Opportunity Attachments" and make it a master detail to the opportunity.
2. Enable Attachments on this object
3. Remove the Attachments related list on the opportunity page layout and replace it with the Opportunity Attachments related list. 

Advantage:
You can now put a roll-up summary field on the Opportunity called "Number of Attachments" and report on Attachments.

Disadvantage:
1. Your users will have to create a record to put their attachments onto.
2. There is nothing preventing your users from putting more than one attachment on the Opportunity Attachment record. 


Best Regards
Naga Kiran
Inna ChigarevaInna Chigareva
Hi Naga,

If I do that, how do I save all existing notes and attachments for every record?


Regards,
Inna