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
jsacpt24jsacpt24 

if checkbox = true then must attach file

I have a custom object that I am trying to enforce that if checkbox = true they must attach a file. Any thoughts on how this would be accomplished? Or more if this is able to be accomplished? 
SalesFORCE_enFORCErSalesFORCE_enFORCEr
You have to write a trigger on Attachment object and populate a field on the Parent object to show the count or name of the attachments. Then, create a validation rule to check if the checkbox is true and the count of attachment is 0 then throw an error message.