Thursday, January 20, 2022

Formula BestPractices

Tip 1: Put Every Function on a Separate Line

Place each function on its own line makes the formula easier to read and troubleshoot.

IF(AND(ISBLANK(myDate_c),active_c=true),"Missing Date","Not Applicable")

IF(

AND(

ISBLANK(myDate_c),

active_c=true

),

"Missing Date",

"Not Applicable"

)

Tip 2: Indent Sections Within Parentheses

When your formula involves multiple functions, indentation helps visually isolate each function and makes it easier to identify errors, such as misplaced characters.

In this example, with indentation, you see that the bulk of the formula sits within a single IF statement and that the AND statement contains two functions. Inside the AND statement, the function ISBLANK is enclosed in parentheses.

IF(

  AND(

    ISBLANK(myDate_c),

    active_c=true

  ),

  "Missing Date",

  "Not Applicable"

)

Indentation can also help you zero in on mistakes. 

IF(

AND(

ISBLANK(myDate_c)

),

active_c=true

),

"Missing Date",

"Not Applicable"

)

The indented layout makes it easy see the formula’s structure. You can quickly find and remove the extra character so that the AND statement is correctly formatted.


IF(

  AND(

    ISBLANK(myDate_c)

    ),

    active_c=true

  ),

  "Missing Date",

  "Not Applicable"

)

Tip 3: Write Statement and Function Names in Uppercase

All the examples here use uppercase letters for statement and function names, such as IF, AND, and ISBLANK.

Tip 4: Handle Null and Required Input Field Values

These examples reference a field called myDate__c and use the ISBLANK check to confirm that the field is populated. It’s important to verify the contents of any field in a formula. Without this verification, a formula can fail. 

IF(

  AND(

    ISBLANK(myDate__c),

    ISBLANK(mySecondDate__c),

    active__c=true,

    mySecondDate__c > myDate__c

  ),

  "Missing Date",

  "Not Applicable"

)

Friday, January 14, 2022

Salesforce API's

 Application Programming Interface(API), which is a software intermediary that allows two applications to talk to each other.

Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.

Below are some of the APIS that we use in Salesforce.

API

When to Use

SOAP API 

Integrate your org’s data with other applications using standard SOAP protocols. 

REST API 

Access objects in your org using standard REST protocols. 

Metadata API 

Manage customizations in your org and build tools that manage your metadata model. 

Tooling API 

Build custom development tools for platform applications. 

Marketing Cloud API 

Expose Marketing Cloud capabilities with the REST API and get comprehensive access to most email functionality with the SOAP API. 

Bulk API 

Load, delete, and perform asynchronous queries on large data sets. 

Streaming API 

Send and receive notifications securely and efficiently. Notifications can reflect data changes in your org, or custom events. 

Connect REST API 

Build UI for Commerce, CMS-Managed Content, Experience Cloud Sites, Files, Notifications, Topics, and more. 

Mobile SDK 

While it’s technically a software development kit, it’s worth including here. Integrate Native or Hybrid mobile apps directly with Salesforce. 


ES12 new Features