As Developers or the Salesforce Admins thinking of coding, we are always looking for quick and easy ways to create fully functioning applications in as smaller time frame as possible. With many APIs available from a variety of sources these days, Developers can often achieve this, and Salesforce is no exception.
Hosting a variety of APIs, Salesforce has opened its doors to hundreds of companies and Developers across the globe, and in turn, accumulated an app store boasting over 1000 applications that integrate with its functionality.
So as a Developer, you have registered an application, you have gained an access token and you have successfully made a call to the Salesforce API and displayed some useful information on a page. Not bad for a couple of hours work eh? Before you get too carried away with how remarkably simple it is to create that basic application, you need to bare in mind the difference between those apps in the top 10 of the AppExchange and those that are rooted to the bottom.
Here are a few things to think about when creating your application:
Consider that Salesforce is a highly customizable piece of software, that comes in many different versions and flavours. What objects and fields exist in one organization’s Salesforce instance, may not exist in another’s. Hard coding a list of fields in your select statements will be guaranteed to return you errors for some users, and inevitably result in poor reviews on the AppExchange when functionality stops working. Use the full benefits the API has to offer; describe objects, check access to fields and dynamically create your queries on a per user basis.
I bet you’re thinking – isn’t this a lot more work for the system? Use caching services and storage solutions where possible to save you reverting back to Salesforce for common requests.
Perhaps the most important thing to consider when using the Salesforce API, is the fact that every org has a limit to the number of API calls that can be made during a 24-hour period. Ensure you monitor this closely, and take appropriate action if you start encroaching on these limits. If your application is going to make 10000 API calls and hour, you need to stop and rethink your approach. Capping out an organizations API limit can have devastating effects on their business processes, depending on what they are. Be sure to expect some 1 star reviews and some very angry clients if your application is the cause of this. A few simple checks on call responses and some messaging to the client can save you a lot of trouble further down the line.
Similarly to API limits, organizations are also limited by the amount of data they store in their Salesforce instance. Again, run the appropriate checks, and think carefully about your approach if you are planning on regularly adding half a million objects to a Salesforce instance.
Salesforce is used in hundreds of countries across the globe so when handling data such as dates and times you need to respect this. Displaying date/time fields in UTC to a user in Australia is of absolutely no use to the end user whatsoever, and similarly adding records without respecting the local time zone will simply contaminate a Salesforce instance with bad data. Bugs in this area will affect a huge proportion of your global client base, and can potentially render your app useless. Again, Salesforce provides time zone information via the API so use it.
Organizations that use Salesforce are predominantly hierarchical in some form or another, and as such, Salesforce provides various levels of permission sets, field permissions and access to various objects and features. Accessing user profiles and roles can provide you a lot of this information, so make sure you make use of this before trying to access areas that are for administrators, with a token for a standard sales user. Similarly, undermining an organization’s hierarchy is another sure way to get yourself some more of those ugly 1 star reviews on the AppExchange!
Rules and Triggers
Other core features are email alerts in Salesforce
, custom rules, workflows and triggers. These are event driven processes that happen off the back of user actions and data changes, but can be triggered also when using the API to create or modify. Ensure communication to the end user is an informative as possible so that they know that your app may cause waves and other knock on effects.
For those of you who don’t know what this means – read the API documentation! Shockingly, many Developers neglect to do this, to the detriment of development time and quality. When creating any solution using APIs, you need to understand the behavior of Actions to the letter, and Salesforce is again no exception!
Use the Right API
Salesforce provides a range of APIs, each supporting different features so ensure you use the right one for your app. For example, if you are loading data on mass, to simply provide some reporting feedback on your platform, the Bulk API will likely be the one you want to go for. Similarly, if you are using highly variable dynamic queries on specific objects and fields, the REST API may be more appropriate. Again, read the documentation for each carefully, so that you fully understand the impact and capabilities of each. Using the wrong API will very rapidly hinder the flexibility and scalability of your application, and ultimate you will end up spending more time in development when it comes to rewriting parts of your product.
It is important to remember when building 3rd party applications for Salesforce that handling data in a professional and useful manner for the end user is paramount to making your application a success. Keeping the above points in mind will take you some of the way, but be sure to keep your application flexible, scalable and handle errors and responses properly and with appropriate messaging to your end users.
Happy coding! Click here for more Salesforce Admin