+ Start a Discussion
Frances AllenFrances Allen 

Salesforce File Validation on Opportunity

I want to preface that I am using the newest version of files for Salesforce Lightning, not classic Notes and Attachments.

We want to ensure that at least one file is uploaded to an opportunity in notes and attachments ( we have enabled files so the upload is of Salesforce files ). 

I cannot see how validation is possible from the opportunity itself. Is anyone doing this without using Process Builder or a Trigger? 

Thanks in Advance.
Just to clarify, You have an Opportunity and you want to make the presence of at least one Salesforce File related to it in order to save the Opportunity?
Frances AllenFrances Allen
Yes, we want a Salesforce File attached to the opportunity. We've now enabled Saleforce File Upload in place of what Notes and attachments was.
Waqar Hussain SFWaqar Hussain SF
You can only attach file to opportunity after saving it. And for validating opportunity to have at least one file, you will have to write before update trigger to validate at least one opportunity. This can not be done via process builder.