I came across this approach when the REST approach did not work for one of my clients.
When a lead submits a form, all form builders provide the functionality to send email notification along with data submitted by lead. This email can also contain files uploaded by the lead.
For my client, we created an email service that would process this email and convert it to a lead. The files in the email can also be attached to the lead.
So we added the Salesforce email service in the form builder, and whenever a lead submitted the form, the notification would go to Salesforce. The email service apex class would then process the email to create the lead along with the files uploaded by the lead.
While this is not a point and click approach, it definitely needs some coding, there are few advantages to this approach:
- While many Salesforce developers might not know the REST API approach or even uploading the file to web server, most Salesforce developers know how to code for the email service class. It is actually quite basic.
- Your logic remains in Salesforce and is not distributed at multiple places.
- Your files are stored in Salesforce.
What’s more, my client asked me to make the class as flexible as possible. So he could add new forms or fields to existing web forms without modifying the class. And the same is easily feasible through the use of custom settings of list type.
Do try this approach and let me know your thoughts. I really liked the simplicity of this approach.