How to convert sObject to JSON String and JSON string to sObject using apex in Salesforce?

Sample Code:

Contact con = new Contact(FirstName = 'First', LastName = 'Last', Phone = '9999999999', Email = 'Test@test.com');
/* Code to convert Contact to JSON string */
String strJSON = JSON.serialize(con);
system.debug('JSON String is ' + strJSON);
/* Code to conver JSON string to Contact */
Contact con1 = (Contact)JSON.deserialize(strJSON, Contact.Class);
system.debug('Contact is ' + con1);

Output:


Cheers!!!

How to hide lines and borders in pageBlock tag in Visualforce?

Sample Code:

Visualforce page:

<apex:page standardController="Account" sidebar="false">
 <style>
    .bPageBlock .pbBody .dataCol {
        border:0px;
    }
    .bPageBlock .pbBody .labelCol {
        border:0px;
    }
</style>
    <apex:form >
        <apex:pageBlock mode="maindetail"  >
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{!Account.Name}"/>
                <apex:inputField value="{!Account.Industry}"/>
                <apex:inputField value="{!Account.Description}"/>
                <apex:inputField value="{!Account.Phone}"/>
                <apex:inputField value="{!Account.Rating}"/>
                <apex:inputField value="{!Account.Fax}"/>
                <apex:inputField value="{!Account.Type}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Output:


Cheers!!!

Approval Post Templates in Salesforce

Approval post templates allow you to customize the content of approval request posts in an assigned approver's feed. Approval request posts are not private. Anyone with access to the approval object can view and comment on an approval request post.

1. Go to Chatter Settings.


2. Enable Allow Approvals through Chatter.


3. Create Approval Process.

4. Go to Post Templates.


5. Create a Post Templates.


6. Select Post Template created in the Approval Process.


7. Post Template feed will be looking like below.


Cheers!!!

How to set debug log for Community Guest User?

1. Go to Domains.


2. Select the URL of Community


3. Select the Community.


4. Click Public Access Settings button.


5. Click Assigned Users. Get the username.



6. Go to Debug Logs.

7. Click New and select the user.

8. If you are in chrome execute the below command in the console.

document.cookie="debug_logs=debug_logs;domain=.force.com";


9. You will start seeing debug logs for the community guest user.

Cheers!!!

How to dynamically determine Calling Context using Apex in Salesforce?

Batch - System.isBatch()
@future - System.isFuture()
Queueable - System.isQueueable()
Schedulable - System.isScheduled()
Trigger - Trigger.isExecuting

Visualforce - ApexPages.currentPage() != null
Apex REST - RestContext.request != null

Sample code to execute in Developer Console

system.debug('Batch is ' + System.isBatch());
system.debug('@future is ' + System.isFuture());
system.debug('Queueable is ' + System.isQueueable());
system.debug('Schedulable is ' + System.isScheduled());
system.debug('Trigger is ' + Trigger.isExecuting);
system.debug('Visualforce is ' + ApexPages.currentPage());
system.debug('Apex REST is ' + RestContext.request);

Output:


Cheers!!!

Group Engagement in Salesforce

View group member engagement in a convenient report linked from each group. See the number of members, posts, comments, likes, questions, and answered questions in a single view for each group. This feature is available in Salesforce Classic only.

Anyone with permissions can view the group engagement report. Group owners, managers, and other users with permissions (for example, users with the “Modify All Data” and “Manage Unlisted Groups”) can quickly access this report by clicking Show Group Report below the group photo.


Check the below link for more information

https://releasenotes.docs.salesforce.com/en-us/spring16/release-notes/rn_chatter_group_engagement_reports.htm

Cheers!!!

Global Constant In Process Builder in Salesforce

Choose a global constant to set a value to null or an empty string. For example, choose $GlobalConstant.Null.

Two global constants are

1. $GlobalConstant.Null
2. $GlobalConstant.EmptyString

Scenarios for Process Builders:

1. While using update action in Process builder for Contact records and then if we want to clear Account field, then we can use $GlobalConstant.Null. We cannot use $GlobalConstant.EmptyString since the lookup field cannot be mapped to blank string.

2. While using insert or update action in Process builder and if we would like to update any field with blank value, then we can use $GlobalConstant.EmptyString.

Difference between IsBlank and IsNull - http://www.infallibletechie.com/2012/09/difference-between-isblank-and-isnull.html

Cheers!!!

Salesforce Winter '18 Quick Summary

Chatter Answers Retires in Winter ’18

Start planning that retirement party for Chatter Answers! After years of faithful service helping users find answers to their pressing questions, Chatter Answers is calling it quits in Winter ’18. Salesforce will no longer support Chatter Answers, and users of Chatter Answers will no longer be able to post, answer, comment, or view any of the existing Chatter Answers data. Chatter Answers is passing the torch to Chatter Questions, an eager young thing ready to take up the self-service mantle.

Use Einstein Lead Scoring in Salesforce Classic

Add the Lead Insights component to your Salesforce Classic lead page layouts so that sales reps see their leads’ scores and the insights that support them. This change applies to Salesforce Classic only.

Set Up Person Accounts with Ease

Ready to start using person accounts? You picked a great time because we steamlined the
enablement process. This change applies to both Lightning Experience and Salesforce Classic.
An automated process checks whether or not your org meets the requirements for using Person
Accounts. The requirements are:

• At least one record type for accounts.
• Users that have read permission on accounts have read permission on contacts.
• Organization-wide default sharing is set so that Contact is Controlled by Parent or Account
and Contact is Private.

From Setup, enter Account Settings in the Quick Find box, and then select Allow Customer Support to enable Person Accounts. After we confirm that your org is ready for Person Accounts, we’ll send an email with additional information about logging a Support case.

Collaborative Forecasts: Do More with Sales Predictions

Configure Collaborative Forecasts in Lightning Experience. Forecasts users also get more information and can do more when they’re projecting sales. These changes apply to Lightning Experience only.

Enterprise Territory Management: Configure and Manage Sales Territories in Lightning Experience

Configure Enterprise Territory Management in Setup without switching to Salesforce Classic. And reps can now manage their sales territories in Lightning Experience. These changes apply to Lightning Experience only.

Opportunities: Opportunity Teams, Opportunity Products

Working with opportunities in Lightning Experience is more efficient than ever! Your users can now add an entire opportunity team in fewer clicks. And, increase the completeness of opportunities by prompting users to add products immediately when they create or clone an opportunity. These changes apply to Lightning Experience only.

Sales Console: Welcome Forecasting to the Console

You’ve been patiently waiting for Collaborative Forecasts to come to the Lightning Sales Console. The wait is over! Plus, we’ve made other great improvements to Lightning console apps, including the ability to add favorites, navigation rules to make your users’ workflow more efficient, and additional keyboard shortcuts.

Lightning Dialer: Voicemail Greeting and Company Number

Sales reps can now record custom voicemail greetings and display a standard company number when making outgoing calls. These changes apply to Lightning Experience only.

List Views: Customizations, Mass Inline Editing, and Text Wrapping

Reps can get more done with fewer clicks when working from list views. Edit multiple records from a list view, and wrap text in columns to see more at a glance.

Cloud Scheduler Is Retired

The Cloud Scheduler is no longer available. Reps can’t propose new meetings with the New Meeting Request button on events. Existing proposals indicate that the feature is no longer available and suggest that invitees contact the organizer. This change applies to Salesforce Classic only.

Merge Person Accounts in Lightning Experience

Sales reps can now view duplicates on person accounts in Lightning Experience just as they can on business accounts, contacts, and leads. Users with permission can merge person accounts, too. This change applies to Lightning Experience only.

Do More with the Ask Button

In the Community Builder, the Ask Button component has two new options: Show topics and Show details. They give you more control over the appearance of the Ask Question dialog and give your members the best experience. This change is available in Lightning communities.

Get External Files in Communities

Your external files are vital content resources, so naturally you want access to them from your community. Previously only available in Salesforce Tabs + Visualforce communities, you can now access external files in your Lightning communities using Files Connect. Access files from Quip, Google Drive, SharePoint, Box, and OneDrive for Business.

Create Custom File Preview Components

A new Lightning component, Files Preview, makes it easy for your users to preview and take quick action on files. The Files Preview component displays a preview of the file with file actions clearly labeled across the top. When a file can’t be previewed, the preview shows an icon of the file’s type.

Spice Up Your Conversations with Emojis

Emojis have arrived! Engage your audience by adding zest to your feed. When you post, comment, and add details to your questions, or when you answer questions, the emoji icon appears in the Chatter publisher. Emojis are available in Lightning Experience and Lightningcommunities.

Enable Topic Suggestions For Your Org

Topics suggestions are helpful when you want to encourage folks to add topics to their posts and questions. At the same time, having the flexibility of turning off topic suggestions is also key. We now give you the option to turn off topic suggestions for your org. The permission is enabled by default, so contact Salesforce Customer Support to disable topic suggestions.This change applies to both Lightning Experience and Salesforce Classic.

Create a Custom Report Type to See Your Top Ranked Groups

Find out which groups have the most activity in your org with a new custom report type. Create the custom report type using Groups as the Primary object, and monitor your groups’ rankings accordingly. This feature is new in both Lightning Experience and Salesforce Classic.

Create and Collaborate on Quip Documents in Salesforce

Quip lets you create, share, and collaborate on documents and spreadsheets in Salesforce. No need for an external file provider. In Lightning Experience, use the Quip component on records to create new Quip documents and work with existing ones. Work with Quip documents in Chatter, Files home, and Files related lists. Quip is available in Lightning Experience, Salesforce Classic, and communities.

Get Performance Information with the Salesforce Community Page Optimizer

The free Salesforce Community Page Optimizer analyzes your community and identifies issues that impact performance. Use the information to refine your design and improve community performance for your members.

View Related List Data Quickly with Related List Quick Links

Are your users tired of clicking View All to see all the columns in a related list? With the Related List Quick Links component, they can view multiple related lists in quick succession just by hovering over a link. And, they can complete actions right from within the hover pane.

The Related List Quick Links component is available for record pages only.

Let Users Hold Video Meetings and Send Instant Messages Right from a Record with the Cisco Spark for Salesforce Component

As part of the new Cisco Spark for Salesforce feature, the Cisco Spark for Salesforce component is now available in the Lightning App Builder. Add it to record pages to let your users initiate video meetings and send and receive instant messages right from the record they’re visiting.

Set More Variable Values in the Flow Component

You can now set values for your picklist and multi-select picklist variables directly from the properties pane. These changes apply to both Lightning Experience and Salesforce Classic.

Configure a Flow to Wait for a Platform Event to Occur

You can now subscribe to platform events in a flow Wait element. With platform events, a flow can wait for something to occur, inside or outside your Salesforce org. Previously, a flow could wait only for a relative or absolute date/time value. This feature is new in both Lightning Experience and Salesforce Classic.

Start a Process When a Platform Event Occurs

You already know the power of automating a business process based on record changes in your Salesforce org. But what if some of your business-critical events don’t happen inside your Salesforce database? No problem. Create a process that starts when a platform event occurs. This feature is new in both Lightning Experience and Salesforce Classic.

Quickly Reference Specific Users and Queues in Your Processes

Say hello to a more intuitive way of referencing users in your processes. Instead of manually entering a user ID, simply search for that user by name. You can also search for queues. This change applies to both Lightning Experience and Salesforce Classic. The ID and Reference value types didn’t go anywhere. You can still enter the user or queue ID manually or reference a field.

Access Encrypted Data in Process Builder 

Process Builder now supports encrypted fields, except in filters in the Update Records action. This feature is new in both Lightning Experience and Salesforce Classic.

Turn On Multiple Currencies Without Contacting Support

It’s now possible to enable multiple currencies instantaneously without contacting Salesforce Customer Support, or locking your org. These changes apply to Lightning Experience, Salesforce Classic, and all versions of the Salesforce1 mobile app.

Salesforce Connect: Batch Apex, External Object Validator, and Continued

Use batch Apex to process large sets of external object data. Use the Salesforce Connect Validator to quickly test common user and code interactions with external objects. Let us know what you think about the continued pilot for tracking external object data callouts with event log files.

Manage Inactive Picklist Values Easier with Pagination

Track your inactive picklist values better with pagination, even if you have thousands of them. And pagination also helps the pages displaying the values load faster. This feature is new in both Lightning Experience and Salesforce Classic.

Actions Included on a Page Layout Are No Longer Deletable

Deleting an action that is included on a page layout can break the publisher, the other actions on the page, or the entire page. To avoid mistakes, you can no longer delete actions that are used on a page layout. This change applies to both Lightning Experience and Salesforce Classic.

Deploy Named Credential Callout Options via Change Sets, Packages, or Metadata API

When defining a named credential, you can specify whether to customize headers and bodies of Apex callouts that use the named credential. Previously, those callout options were set only via the user interface. Now they can be deployed via change sets, packages, or Metadata API, so you don’t need to manually configure the callout options after deployment. This change applies to both Lightning Experience and Salesforce Classic.

Check Your Encryption Coverage with Encryption Statistics (Beta)

The Encryption Statistics feature shows Shield Platform Encryption customers how much of their data is encrypted with an active tenant secret. Get key statistics for maintaining compliance, stay on top of your key rotation obligations, and streamline the mass encryption process. To enable this feature, contact Salesforce Support. This feature is available in Lightning Experience, Salesforce Classic, and all versions of the Salesforce1 mobile app.

Encrypt Opportunity Description and Next Step Fields (Beta)

You can encrypt the Opportunity Description and Next Step fields in sandbox and production environments. Contact Salesforce to activate this feature. This feature is available in Lightning Experience, Salesforce Classic, and all versions of the Salesforce1 mobile app.

Get Your Pages Ready for Lightning Experience

Want to know if the Visualforce pages in your org are ready for Lightning Experience? Use the Lightning Experience Visualforce check to generate a report that flags pages that need changes before they’re ready for prime time in Lightning Experience. This change applies to Lightning Experience only. Run the Lightning Experience Visualforce Report directly from your Lightning Readiness Report PDF. The Visualforce Report looks at all pages in your org used in the past 90 days, and identifies features that aren’t available in Lightning Experience.

Deployments Now Recompile of All Apex Code

All of an org’s Apex code is now recompiled automatically before completing a metadata deploy, change set, a package install, or a package upgrade (including push upgrades).

Customize Console Apps with the Lightning Console JavaScript API 

The Lightning Console JavaScript API includes new and updated methods that let you customize a Lightning console app and utility bar programmatically. These changes apply to Lightning Experience only.

Cheers!!!

Sample Partial DML Apex code in Salesforce

Sample Code:

List < Contact > conList = new List < Contact > {
new Contact(FirstName = 'Test0', LastName = 'Test0', Department = 'Finance'),
new Contact(FirstName = 'Test1', LastName = 'Test1', Department = 'Technology'),
new Contact(FirstName = 'Test2', LastName = 'Test2', Department = 'Finance'),
new Contact()
};

Database.SaveResult[] srList = Database.insert(conList, false);

for (Database.SaveResult sr : srList) {
if ( sr.isSuccess() ) {
// Develop code for sucessfully inserted contacts
System.debug('Successfully inserted contact. Contact ID: ' + sr.getId());
} else {
for ( Database.Error err : sr.getErrors() ) {
// Develop code for failed contacts
System.debug(err.getStatusCode() + ' : ' + err.getMessage() + ' : ' + err.getFields());
}
}
}


Cheers!!!

Simple Inbound REST API using Apex in Salesforce

Sample Code:

@RestResource(urlMapping='/Account/*')
global with sharing class sampleRest {
  
    @HttpGet
    global static Account doGet() {
        RestRequest req = RestContext.request;
        String memberId = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1);
        Account result = [SELECT Id, Name FROM Account WHERE Id = :memberId];
        return result;
    }
  
    @HttpPost
    global static String doPost(String name, String descrp) {
        Account a = new Account(Name = name, Description = descrp);        
        insert a;
        return a.Id;
    }

    @HttpDelete
    global static void doDelete() {
        RestRequest req = RestContext.request;
        String memberId = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1);
        Account memb = [SELECT Id FROM Account WHERE Id = :memberId];
        delete memb;
    }
    
}

To test in POSTMAN Client extension, check the below

1. Create a Connected App.




2. Create Auth. Provider.



3. Get the access_token first try GET, POST and DELETE.


GET


POST


DELETE


To test in Workbench, check the below

GET


POST


DELETE


Cheers!!!

Simple Outbound REST API with XML Response using Apex in Salesforce

Remote Site Settings:


Visualforce Page:

<apex:page controller="RESTAPIXMLResponseController">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection>
                <apex:pageBlockSectionItem>Customer No: <apex:inputText value="{!strCustomerNo}"/></apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Fetch" action="{!fetchAPI}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        
        <apex:pageBlock>
            <apex:repeat value="{!mapCustomer}" var="c">
                {!c} - {!mapCustomer[c]}<br/>                 
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex Class:

public with sharing class RESTAPIXMLResponseController {

    public String strCustomerNo {get;set;}
    public Map < String, String > mapCustomer {get;set;}
    
    public RESTAPIXMLResponseController() {
    
    }
    
    public void fetchAPI() {
        mapCustomer = new Map < String, String >();
        String endpoint = 'http://www.thomas-bayer.com/sqlrest/CUSTOMER/' + strCustomerNo + '/';
        HTTP h = new HTTP();
        HTTPRequest req = new HTTPRequest();
        req.setEndPoint(endpoint);
        req.setMethod('GET');
        HTTPResponse res = h.send(req);
        Dom.Document doc = res.getBodyDocument();
        Dom.XMLNode customer = doc.getRootElement();
        for ( Dom.XMLNode child : customer.getChildElements() ) 
            mapCustomer.put(child.getName(), child.getText());
    }
    
}

Output:


Cheers!!!

Simple Outbound REST API with JSON Response using Apex in Salesforce

Remote Site Settings:


Visualforce Page:

<apex:page controller="RESTAPIJSONResponseController">
    <apex:form>
        <apex:pageBlock>            
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Fetch" action="{!fetchAPI}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        
        <apex:pageblock>
            <apex:pageBlockSection>
                <apex:pageBlockTable value="{!listWrapper}" var="obj">
                    <apex:column value="{!obj.id}" headerValue="Id"/>
                    <apex:column value="{!obj.login}" headerValue="Login"/>
                    <apex:column value="{!obj.url}" headerValue="URL"/>
                    <apex:column value="{!obj.description}" headerValue="Description"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>

Apex Class:

public with sharing class RESTAPIJSONResponseController {

    public List < JSONWrapper > listWrapper {get;set;}
    
    public RESTAPIJSONResponseController() {
        listWrapper = new List < JSONWrapper >();
    }
    
    public void fetchAPI() {
        HTTP h = new HTTP();
        HTTPRequest req = new HTTPRequest();
        req.setEndPoint('https://api.github.com/users/hadley/orgs');
        req.setMethod('GET');
        HTTPResponse res = h.send(req);  
        JSONParser parser = JSON.createParser(res.getBody());
        listWrapper = (List < JSONWrapper >) JSON.deSerialize(res.getBody(), List < JSONWrapper >.class);
        /*
           If the response contains only one value instead list, then you can use the below code
           JSONWrapper obj = (JSONWrapper) JSON.deSerialize(res.getBody(), JSONWrapper.class); 
           listWrapper.add(obj);
        */
    }
    
    public class JSONWrapper {
        public String login {get;set;}
        public String id {get;set;}
        public String url {get;set;}
        public String repos_url {get;set;}
        public String events_url {get;set;}
        public String hooks_url {get;set;}
        public String issues_url {get;set;}
        public String members_url {get;set;}
        public String public_members_url {get;set;}
        public String avatar_url {get;set;}
        public String description {get;set;}
    }
    
}

Output:


Cheers!!!

How to download and setup Oxygen Eclipse for Force.com IDE?

1. Go to https://www.eclipse.org/downloads/eclipse-packages/.

2. Select 32 bit or 64 bit based on your computer.

To know whether your system is 32 bit or 64 bit, use the below link

http://www.infallibletechie.com/2013/06/how-to-know-whether-my-system-is-32-bit.html


3. Click Download.


4.  Extract the downloaded file.

5. Move the extracted eclipse folder to your desired location. In my case, I have moved the extracted folder eclipse to C drive.

6. Create a folder with the name Workspace inside the eclipse folder.


7. Double click eclipse.exe to open Eclipse.


8. Click Browse and select the folder created in step 6. Click Launch to open.


9. Navigate to Help --> Install New Software.


10. Click Add.


11. Enter the below Details.

Name: Force.com IDE

Location: https://developer.salesforce.com/media/force-ide/eclipse45


12. Click Select All and click "Next".


13. Click Next again.

13. Accept the agreement and click "Finish".

14. Restart Eclipse after installation.

15. Navigate to Windows --> Perspective --> Open Perspective --> Other.


16. Select Force.com and click Open.


17. Navigate to File --> New Force.com Project.


18. Enter Project name and credentials. Click "Finish" button to create the force.com project.

References:
https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_install.htm
https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_install_troubleshooting.htm

Cheers!!!

Chatter Streams in Salesforce

Chatter streams are custom feeds that you create by combining multiple related feeds. Look for streams on your Chatter home page. Create up to 100 streams that each combine posts from up to 25 different feeds and feed types. Create streams that combine feeds from people, groups, and records, like accounts, opportunities, cases, and more.

1. Go to chatter tab and get started. Click + to create a chatter stream.


2. Enter details and Save Chatter Streams Salesforce.


You will be able to see all the feeds related to the records selected. You can select records across all objects.

Cheers!!!

How to get matching records from Duplicate Rule failure in Salesforce using Apex?

Sample Code:

        Contact contact = new Contact(LastName = 'Test');
        Set < Id > duplicateIds = new Set < Id >();
Database.SaveResult saveResult = Database.insert(contact, false);

        if ( !saveResult.isSuccess() ) {
            for ( Database.Error err : saveResult.getErrors() ) {
                if ( err instanceof Database.DuplicateError ) {
                    Database.DuplicateError duplicateError = (Database.DuplicateError)err;
                    Datacloud.DuplicateResult duplicateResult = duplicateError.getDuplicateResult();
                    Datacloud.MatchResult[] matchResults = duplicateResult.getMatchResults();
                    Datacloud.MatchResult matchResult = matchResults[0];
                    Datacloud.MatchRecord[] matchRecords = matchResult.getMatchRecords();
                    for ( Datacloud.MatchRecord matchRecord : matchRecords ) 
                        duplicateIds.add(matchRecord.getRecord().Id);
                }
            }
        }

Reference Link - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Datacloud_DuplicateResult.htm

Cheers!!!

Desk.com to Service Cloud Migration

If you are interested in Desk.com to Service Cloud Migration, check the below link for considerations.

https://org62.my.salesforce.com/sfc/p/#000000000062/a/0M0000005YV6/ghp0ivVVphPCz83zZ4Y7AoUkA6lPd3.yPKu5jkvThCM

Before you move into the implementation phase of your project, it’s best to have some important pieces in place. These include a solid project team and a set of requirements for go-live. This unit helps you put together a preliminary structure for executing a successful move to Service Cloud.

When it comes to implementing a new solution, there are a lot of components to consider. What do you roll out in Phase 1 versus Phase 2 (or beyond)? For example, do you need all of those macros moved over to Service Cloud immediately, or is this transition a good time to do some spring cleaning and only migrate the few that your team regularly uses?

Note:
There are few trailhead modules specially designed for migration of Desk.com to Service Cloud.

Cheers!!!

{“error”:“unsupported_grant_type”,“error_description”:“grant type not supported”}

When you face {“error”:“unsupported_grant_type”,“error_description”:“grant type not supported”} error, put all the information in the body instead of header.


1. If you are using POST, check whether the Content-Type is set as application/x-www-form-urlencoded.

2. Check whether setBody() has correct body data.

Cheers!!!

Salesforce Interview Questions with Answers Part 44

1. Describe some SF best practices and patterns that you have used? 

https://developer.salesforce.com/page/Apex_Design_Patterns

2. What is tuning performance? How do you increase it?

https://developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/salesforce1/vf_dev_best_practices_performance.htm

3.What is apex design pattern? What is continuous pattern?

https://developer.salesforce.com/page/Apex_Design_Patterns

4.One child record per one master details how would you achieve it?

http://www.infallibletechie.com/2013/05/how-to-create-one-to-one-relationship.html

5.Salesforce design pattern

https://developer.salesforce.com/page/Apex_Design_Patterns

6.What is asynchronous Apex?

@future, Queueable Interface, Batch Class.

7. What is the future method?

http://www.infallibletechie.com/2012/08/future-annotation-in-salesforce.html

8. What is Queueable Apex?

http://www.infallibletechie.com/2016/08/queueable-apex.html

9. What is Batch Apex?

http://www.infallibletechie.com/2012/05/batch-apex.html

10.How many batch job can be in the single queue?

You can only have 25 classes scheduled at one time. You can evaluate your current count by viewing the Scheduled Jobs page in Salesforce or programmatically using the Force.com Web services API to query the CronTrigger object.

While the batch apex states:

Up to five queued or active batch jobs are allowed for Apex.

10.The difference between Workflow and Process builder? 

http://www.infallibletechie.com/2016/07/what-is-difference-between-process.html

12.What is flow?

http://www.infallibletechie.com/2014/05/visual-workflow-in-salesforce.html

13. What are the steps for inbound, and out bound web service calls?

https://developer.salesforce.com/blogs/developer-relations/2015/06/integrating-force-com.html

14. How to handle the error in Apex (class)?

https://developer.salesforce.com/page/An_Introduction_to_Exception_Handling

15. Salesforce Case Management?

http://www.infallibletechie.com/2014/12/case-management-in-salesforce.html

Cheers!!!

Conditional Rendering in Lightning Component using aura:if in Salesforce

Lightning Component:

<aura:component>

<aura:attribute name="strTest" type="String"/>

<aura:if isTrue="{!not(empty(v.strTest))}">
True
<aura:set attribute="else">
False
</aura:set>
</aura:if> 

</aura:component>

Check the below link for more methods

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/expr_functions.htm

Cheers!!!

What Are Data Integration Rules in Salesforce?

Data integration keeps your data up-to-date. When you activate a data integration rule, Salesforce immediately checks your existing records against a data service to see if new data is available. New records are checked when they're saved. Based on your rule settings, your records are updated with new data.

Data integration rules let you specify the object and fields to update and the data service to use. In addition, the rules let you control triggers and workflow rules for the records that are updated.

1. Navigate to Data Integration Rules.


2. Activate Data Integration Rules.


3. Add Data Integration Rules related list.

4. Create a Formula field as below.


Formula:

'Accuracy - ' & TEXT(BillingGeocodeAccuracy) & ' - Lattitude - ' & TEXT(BillingLatitude) & ' - Longitude - ' & TEXT(BillingLongitude)

Output:


Cheers!!!