Open source project to evaluate rules in Salesforce using Apex
Coming from Java background, we know that there are many open source or free Business Rules Management System (BRMS) tools that can be used like Easy rules or Drools. I was in search of such tool for Salesforce but didn’t find any. There are few AppExchange BRMS products however they are paid and heavy in terms of features needed. Who don’t love free stuff 🙂 and wanted it free and open source. While searching, I came across this post of Martin Fowler and it encouraged me to write my own rule engine for Salesforce.
How to use Integration Value in State & Country picklist in Salesforce
Recently there was an interesting requirement in using State & Country picklist of Salesforce. Salesforce saves ISO code of State & Country picklist in Alpha-2 format however external system connecting to Salesforce needed Alpha-3 format.
There has been already an Idea on Idea Exchange created around 4 year back to support the Alpha-3 format however doesn’t seems much progress from Salesforce product team.
Anyways, there could be multiple way to handle this like, Maintaining Custom Setting , Custom metadata or Custom object for mapping between ISO Alpha-2 and Alpha 3 and use trigger to populate custom ISO field on Account or Contact.
While going through implementation guide of State & Country picklist, there was mention of Integration Value setting, which could be used to store the ISO Aplha-3 code. To see this option, navigate to “Setup | Data Management | State and Country/Territory Picklists | Configure States and Countries and Territories | country name | Edit” . Below image shows the setting
Step by step guide to set up Continuous Integration (CI) for Salesforce using Team Foundation Server (TFS) with video tutorial
I have already written some Continuous Integration (CI) posts for Salesforce previously using different tools like Jenkins. In this blog post we will go through steps to use Microsoft Team Foundation Server (TFS) to set up Continuous Integration.
We can either use cloud based Team foundation Server (TFS) or locally installed on network. For ease, we would be using cloud based TFS for this blog post.
Step 1: Creating developer account on VisualStudio Online
Navigate to https://www.visualstudio.com/ and choose Get Started for free in Visual Studio Team Services section. You may need to create a new Microsoft developer account, if you don’t have it already.
Step 2: Using TFS as source code repository
Once we are able to login to TFS, lets start by creating a code repository. That’s right, you don’t need separate Bitbucket or Github account to save your code/metadata unlike in Jenkins. So, our start with TFS is really good and impressive till this point 🙂 . Wizard to create new project is self explanatory and would look like below image
List of my favorite features in Salesforce Spring 17
In this post, I would be only talking about Generally available (GA) features, excluding pilots and Beta. Saving those awesome features for suitable time to come. So, here are some of my favorite picks from Spring 17.
Imagine we are doing REST API call from external system by creating Account first and then contact. In between if internet connection is gone or user closes browser and only Account created without contact ? From Spring 17, we can reduce number of REST API calls made by combining them in single request. Advantage of this feature would be easier transaction management and API limit saving. You can have up to 25 subrequests in a single call. Up to 10 of these subrequests can be query operations, including Query, QueryAll, and “Query More” requests to obtain the next batch of query results. Continue reading “Salesforce Spring 17 release – My favorite features”
Demo and Example, showing process of documenting Lightning Component
Its extremely important to keep and maintain the documentation of your newly built (and all existing) Lightning component. So that it can be easy to understand and easy to reuse. It will not take much time for your Salesforce Org to flood with Lightning components.
We will take example of previous post, where I shared source code of Circular Progress Bar Lightning Component.
Total – Either Number Or API Name of field. Used to derive percentage of Progress Bar
Actual – Either Number Or API Name of field. Used to derive percentage of Progress Bar. If Object contains percentage type of field, then Total can be blank and this field can only contain API name of field of type percentage
Using open source PMD tool to generate code quality report for Apex classes
PMD is very well known source code analyzer for Java, android and many more languages. Good news for us (Salesforce developers) is , that it supports now Apex. You might be thinking how can we make PMD as part of our daily life ?
There are multiple ways
We can run static code analysis standalone
It can be part of ANT build to generate error reports
Jenkins can use it to generate nice report around code quality
Eclipse can use it as a plugin to generate report
In this blog post, we will discuss option 1, that is running it as a standalone application to generate code quality report.
In above example, each element in collection can be referred using variable “item”. Most of time we find ourselves in situation where we need to get value or component selected in iterator. As we don’t know upfront, how many items would be there, so identifying selected item at run time seems little bit tricky but believe me it easy. Continue reading “Get Selected HTML or Lightning component in Aura Iterator”