Happy New Year and Keep Learning

Once again, the start of a brand new year has come upon us. As we enter into new possibilities, may we all be reminded that we have the ability to be, do, and have anything that we want; that there are no mistakes, only lessons; and that the love and happiness we seek is already within our grasp.  It’s easy to make resolutions and renew our commitments.

As we begin 2019, my prayer is that we continue to grow and find the space within ourselves to know, beyond all doubt, that there is nothing more that we need to do in order to be complete. We don’t need a new exercise plan, more money, a better job, a new car or a bigger house. All we need is a willingness to allow ourselves to feel good and to be at peace in the present moment. All we need is gratitude for all that we have, and all that we have had the pleasure to be and to experience. That is the starting point from which all other things will flow into our existence.
Thank you for the wonderful support that you have given me through the past year! Wishing you a wonderful new year!
2018 was great journey for me both professionally and personally. I would like to share some really important moments –
  • I left Cognizant and joined Appirio Inc., a Wipro company. Leaving Cognizant was really difficult for me, because Cognizant gave me all kind of supports during my Salesforce journey. So Cognizant will always remain special. But Appirio is a company I was always dreaming to be part of. Journey with Appirio is awesome. I met so many great colleagues who are not only great in Salesforce, but more that that, they are great human being. I am enjoying every bit of my Appirio journey.
  • I was feeling so bad leaving my Manulife team and I am still missing the team. I met the greatest team ever in Manulife. 
  • I went to Dreamforce’18. It was HUGEEEEEEE… Again thank you Appirio for giving me the opportunity to be part of Dreamforce.
  • I became leader of Kitchener, CA Developer Group and thank you to Salesforce for giving me the option to contribute to our Salesforce Ohana.
Events from Kitchener, CA Developer Group:

SalesforceDX : Explaining Scratch Org Definition File


Scratch Org definition file is getting used to create the shape of your scratch org. I would say it is the blueprint of your scratch org. You can use this definition file to create multiple scratch org from your repository.

Scratch org definitions come from JSON text files that are stored in your project’s repository and directory structure. When an SFDX project is first created, it comes with a config/project-scratch-def.json file that defines an extremely basic org “shape” for an empty scratch org.
That default scratch org likely looks nothing like your production org. You can use it for developing functionality that isn’t dependent on your org’s settings, or you can customize it using the settings that are available as part of the configuration file, or you can script your process to perform Metadata API deploys or other API actions to control settings that DX does not support yet.

Ideally, the combination of your DX source code (including all your programmatic and declarative customization) with your scratch org definition gets you close enough to Prod instance.

This definition file contains three main important information about your scratch org.

  • Which Edition? As of Winter’19, it supports Developer, Enterprise, Group or Professional
  • Add-on features: Functionalities you want to include while creating the scratch org like communities, StateAndCountryPicklist, LiveAgent etc.
  • Settings: Org and Feature settings used to configure Salesforce products, such as nameSettings, ideaSettings, caseSettings, omniChannelSettings.
Let’s dig into a Scratch Org definition file now –

{
"orgName": "Sudipta Deb Company",
"username": "sudipta-test-scratch@sudipta.com",
"adminEmail": "sudipta.deb@gmail.com",
"description": "This is the scratch org created by Sudipta Deb",
"edition": "Enterprise",
"features": ["Communities", "StateAndCountryPicklist", "LiveAgent"],
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"networksEnabled": true,
"chatterEnabled": true
},
"nameSettings": {
"enableMiddleName": true,
"enableNameSuffix": true
},
"quoteSettings": {
"enableQuote": true
},
"liveAgentSettings": {
"enableLiveAgent": true
},
"omniChannelSettings": {
"enableOmniChannel": true
},
"ideasSettings": {
"enableIdeas": true
},
"caseSettings": {
"emailToCase": true
}
}
}

Now let me explain different parts of this definition file –

  • orgName:  It is just giving a name of your organization in the scratch org. 
  • username: username of the scratch org user
  • adminEmail: Email address of the Dev Hub user making the scratch org creation request.
  • edition: provides the Salesforce edition of the scratch org.
  • description: Giving description of the scratch org. It’s a good practice to provide description.
  • features: In my example, I am enabling communities, StateAndCountryPicklist, LiveAgent in the scratch org.

Action Plan in Financial Services Cloud || Winter ’19 New Feature

In Winter ’19 release, Salesforce introduced Action Plans for Financial Services Cloud. It captures repeatable tasks in templates and then automate the task sequences with an action plan.
Example: Processing Loan application, Customer on-boarding process etc. It will also give you the option to create reports and dashboards to monitor progress and ensure compliance.

It consists of three parts –
Action Plan Template: Power consistent customer experiences with configurable task templates.
Process Automation: Increase productivity by automatically generating tasks with due dates and role based assignment.
Plan Execution: Drive collaboration and complaint task completion with analytics and enforcement of required tasks.

Let’s explain in details –

Action Plan Template

An action plan template is nothing but a list of tasks to complete a business process. In a template, each task is given a priority, the deadlines (the number of days in which it should be completed – data offset), and who is responsible. Then this action plan template is used to create action plans with each task assigned to a user with a completion date.

Below picture will give you a great view of Action Plan Template and Action Plan –

Now let’s start creating one Action Plan:

Pre-requisite

  • Permission Set: You need to assign permission set – ActionPlans to the users. Without this permission set, you will not be able to assign action plan task to those users.
  • Extra Permission: You can provide below standard object permission so that users can edit and delete action plans-
    • Action Plan: Read, Create, Edit and Delete.
    • Action Plan Template: Read, Create, Edit, Delete and View All
  • Status Field Required: This is required to accurately track and report on action plans based on their status. Set the Action Plan Status as mandatory field in Action Plan layout.
  • Action Plan List to Account  Page Layout: Add action plan related list in Account Page layout.
  • Action Plan Lightning Component: Add the Action Plans List – Financial Services Cloud Lightning Component in the page in a separate tab.
  • Setup Nonwork days: Use this option to skip nonwork days when setting up the task completion dates. To do that, you can set the Business Hours and setup company-wide holidays.

Use Case

We will use Action Plan Template to automate new credit card opening processes for financial institute XYZ and then use the template to create the action plan for one of the account. 

Action Plan Template

Let’s start by creating the action template and inside the action template below are the tasks –
Against each task, we have the option of whom to assign the task – we have three options (Action Plan creators, any other user, or the account team member role). We can define the number of days to complete the task and priority. Here is the view –
Finally we can publish the action plan template.

Action Plan

Now with action plan template published, we can login to any account and create the new plan using action plan template. Here is the action plan creation for – XYZ Visa Credit Card 
What happened at the backend, Salesforce has created all the tasks and assigned to owners based on the task configuration. We can see the same from account’s task view.

Considerations

Apex Code to Assign Territories to Opportunities

Assigning Territories to Opportunities can be done manually, but there is an option by which you can automate this process. This blog post is all about writing Apex class to automate the Territory assignment to Opportunity record.

Before I start explaining the Apex code, let me explain two important objects –

  • Territory2Type: This represents the category of Territories(Territory2). Every territory must have a Territory2Type. The important field within this object is Priority, which is used in Opportunity filter to assign Territory to Opportunity.
  • ObjectTerritory2Association: This represents the association between Territory and Object record, which is Account. This is available only if Enterprise Territory Management is enabled.
The Apex code is written here in the Salesforce Developer’s guide. 
The logic is as follows –
  • If the Opportunity’s Account record is assigned to no Territory, then Opportunity’s territory2Id field will be null.
  • If the Opportunity’s Account record is assigned to 1 Territory, then Opportunity’s territory2Id field will be assigned to same Territory record.
  • If the Opportunity’s Account record is assigned to more than 1 Territories, then Opportunity’s territory2Id field will be assigned to that territory record which is having highest priority.
    • If multiple territories are having the same priority, then Opportunity’s territory2Id field will null.
Once you have the apex class written, you can configure the Opportunity Territory assignment filter by going into Setup -> Territory Settings and there providing the apex class name. The screenshot is given below –
Few important point to mention here –
  • The class OppTerrAssignDefaultLogicFilter is provided by Salesforce. But you can write your own class to implement logic as per your business need and use that. You need to make sure that you class is implementing TerritoryMgmt.OpportunityTerritory2AssignmentFilter interface.
  • This class will execute only for those Opportunities where IsExcludedFromTerritory2Filter = false. This is the field named as “Exclude from the territory assignment filter logic” found in Opportunity record. You need to include this field in Opportunity page layout to select/de-select. Otherwise you can use the api to set the value of field IsExcludedFromTerritory2Filter.
  • This apex class can work on maximum 1000 opportunities.