SL proxyAPI Manager

[2018]

I never decided on the name for this project SL proxyAPI Manager or Salesforce Doc Generator, sometimes the naming makes us spend a lot of time. Serious… This was a small project that came up at the request of a friend of mine who has a business that uses the Salesforce CRM platform. The project would be limited (or not) by a shared linux server (cPanel), using PHP and MySQL. I embraced this little challenge because my background was mainly ASP.NET C# and the company where I was we were using PHP and mySQL. It would do just fine.

He needed to generate PDF documents from predefined templates, with data from an object he created in Salesforce. But he wanted to do this outside of the Salesforce platform and without using any plugins or other purchased integrations. As the CRM platform allows you to create “frontend buttons” that can call external links (urls) using parameters, I created a service that receives this call and returns an HTML rendered and merged with the data, thus being able to print or create a PDF.

The Salesforce platform had an API with methods that exposed the object’s data through parameters, and it wasn’t hard to think of start creating a service/API working as a proxy to obtain data from an object in Salesforce as the main bone of the process.

I could generate a final PDF through templates embedded in project, but one of the requirements was that my friend be free to create other templates, thus making it easy in HTML for him or his employees. This way he can create the HTML’s as he wants, as well as include the TOKENs he wants. So I created then a web app, a manager for the “proxy API” where he can create new objects to map, define TOKENs etc… SL proxyAPI Manager.

viewing object, object variables and managing tokens

A third web service was created to be called by the “frontend button” in Salesforce, with the object ID and desired HTML template name, as parameters. Returning the final document rendered in HTML with the data of the object… neat!

(the template is not my design, its an oficial template… I know it’s ugly)