Revising Territory Management

July 27, 2020


“Helps you organize groups of accounts and the sales reps who work with those accounts. You create territories based on territory types.”
Source – Trailhead.

Six things to remember & configure territories

  1. Territory
  2. Territory Type
  3. Territory Priority
  4. Territory Models
  5. Territory Hierarchy
  6. Territiry Model State

Steps to Create

  1. First step is to create “Territory Type” with associated “Territory Priority”
  2. Second Step is to create “Territory Model”
  3. Third step is to create Territory @ Model’s Hierarcy.
  4. Create and Run Rules
  5. Assign the Accounts Manually.
  6. Assign Users.
  7. On Accounts Page Layout add the below two related list

Source : https://trailhead.salesforce.com/content/learn/modules/territory-management-basics

Created my First Salesforce Community

July 26, 2020

Transform SQL Queries to SOQL Queries in a Lightning App

June 20, 2020
public with sharing class Books4EveryoneHomeController {
  @AuraEnabled
  public static List<Book__c> getBooks(){
    return [SELECT ID, Name, Description__c
  FROM Book__c];
  
  }
    @AuraEnabled
public static List<Book__c> getBooksWithoutAuthors(){
  return [SELECT Name
    FROM Book__c
    WHERE Author__c = null];
}
    
@AuraEnabled
public static List<Book__c> getBooksAndAuthor(){
  return [SELECT Name, Description__c, Author__r.Name
    FROM Book__c];
}
    @AuraEnabled
public static List<Recommendation__c> getBookRecommendations(){
  return [SELECT Name, Review__c, Rating__c, Book__r.Name , Book__r.Author__r.Name
    FROM Recommendation__c
    WHERE Book__c != null];
}
      

}
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="Books4EveryoneHomeController">
  <aura:attribute name="Books" type="Book__c" />
  <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
  <lightning:card title="Books4Everyone Books">
    <aura:set attribute="body">
      <table class="slds-table slds-table_bordered slds-table_cell-buffer">
        <thead>
          <tr class="slds-text-title_caps">
            <th scope="col">Book Titles</th>
            <th scope="col">Book Descriptions</th>
            <th scope="col">Author</th>
          </tr>
        </thead>
        <tbody>
          <aura:iteration items="{!v.Books}" var="books">
            <tr scope="row">
              <td> {!books.Name}</td>
              <td> {!books.Description__c}</td>
               <td> {!books.Author__r.Name}</td>
            </tr>
          </aura:iteration>
        </tbody>
      </table>
    </aura:set>
  </lightning:card>
</aura:component>
({
  doInit: function(component, event, helper) {
    var action = component.get("c.getBooksAndAuthor");
    action.setCallback(this, function(data) {
      component.set("v.Books", data.getReturnValue());
      console.log(data.getReturnValue());
    });
    $A.enqueueAction(action);
  }
})

Develop an App with Salesforce CLI and Source Control

May 25, 2020

This is one of the best Project by Trailhead . There is a exhaustive lot you do but every minute you spend on this is worth a dime.

You create a Git Repository , a master branch, two feature branches and then merge them to master and finally deploy this master to a Trailhead playground. While you do this, you also create couple of scratch orgs to modify files. You will really see how everything connects. Go for it mate….experience the SFDX.

While deploying to one of the org, you will face an issue with admin profile. Just delete the admin profile from source code & move on…

Creating a GitHub Repository

Feature Branching


Three Models of Untangling Metadata!

May 23, 2020
Source: https://trailhead.salesforce.com/content/learn/modules/unlocked-packages-for-customers/organize-your-metadata

Basics of working with unmanaged package – Big Picture!

May 21, 2020

Think of a package as a stand-alone application, or a collection of metadata items that you can release on its own without having to release all packages. Packaging metadata makes your deployment process succinct and easier to manage. Packages are organized in a variety of ways, such as by app, by shared library, or by feature. However you organize your metadata packages, it’s important to have the sfdx-project.json file set up correctly so you can create and release new versions of your package.

sfdx force:source:push ; sfdx force:source:pull

May 15, 2020

Managing Scratch Orgs…

May 14, 2020

‘npm’ is not recognized as an internal or external command

$ sfdx force:project:create -n geolocation
ERROR running force:project:create:  Command failed with exit code 1: npm root -g --prefix C:\Users\XXXX\documents\SFDX\my_sfdx_project\.yo-repository --loglevel error
'npm' is not recognized as an internal or external command,
operable program or batch file.

if you get above error. Just install https://nodejs.org/en/download/

Creating my First Scratch Org….

May 12, 2020
sfdx force:org:create -s -f config/project-scratch-def.json -a dreamforce-org

Pushed my local source code to scratch org

Assigned Permission Set

sfdx force:user:permset:assign -n Dreamhouse

Imported Test Data

sfdx force:data:tree:import --plan data/sample-data-plan.json
sfdx force:org:open