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

Attachments counter

Hello everyone,


How do I know how many attached files are in an opportunity? Is there any way to do a counter with workflows? I don't really want to develop APEX code for this...


Thanks in advance!



Jia HuJia Hu
Apex is the most direct way,
Integer count = [Select Count() from Attachment Where ParentId = 'OpportunityId'];
Santhosh KumarSanthosh Kumar

Apex is the only way right now. You could create a batch job to calcuate the attachment counters for all opties,