Saturday, 29 December 2018

Salesforce Winter 19 updates



Salesforce Winter 19 updates

1. Find the Data You Need in a Jiffy with List View Search
Use the new search bar to search the field data in your list views and find the records you need in record time.



2. New attribute in lightning: accordion
Before Winter 19 release, the default behavior of the accordion was that only one section can be opened at a time. If you want to open all the sections at once, it was not supported. The workaround was to use HTML accordion instead of lightning according. But now with Winter 19, Salesforce has introduced a new attribute called allowMultipleSectionsOpen. If this attribute is set to true, then all the sections can be opened at the same time.

3. New component lightning: map
Before Winter 19 release, to display a map, you need to use an external JS library like Leaflet. But with Winter 19, maps will be supported by the platform using lightning: map. This tag is similar to the apex: map tag available on the Visualforce page.




4. Mark Apex Method as Cacheable
The current solution to implement client-side caching is to use setStorable() on every JavaScript action that calls the Apex method. With Winter 19, you can mark an apex method as Cacheable. To cache data returned from an Apex method for any component with an API version of 44.0 or higher, annotate the Apex method with @AuraEnabled(cacheable=true). For example:



To update an existing component to use an API version of 44.0, remove setStorable() calls in JavaScript code. Annotate the Apex method with @AuraEnabled(cacheable=true) instead of @AuraEnabled, or you’ll get an error response for the action.

5. Debug All Your Orgs for Free with Apex Replay Debugger (GA)
One of the coolest features, Apex Replay Debugger simulates a live debugging session using a debug log, which is a recording of all interactions in a transaction. You no longer need to parse through thousands of log lines manually. Instead, Apex Replay Debugger presents the logged information similarly to an interactive debugger, so you can debug your Apex code. With this release, we added checkpoints, which provide more information about your variables than debug logs do.

Apex Replay Debugger is generally available when Salesforce Extensions for VS Code v44 is released on October 13, 2018, replacing the beta version that was released in Summer ’18.

6. Opt Into Fire Platform Events from Batch Apex Classes (Beta)
Batch Apex classes can now opt-in to fire platform events when encountering an error or exception. Event records provide more granular tracking of errors than the Apex Jobs UI. You can get access to information like which records were in scope at the time of failure, and other exception details. Events are also fired for Salesforce Platform internal errors and other “uncatchable” Apex exceptions like LimitExceptions that are caused by reaching governor limits.

To fire a platform event, a batch Apex class declaration must implement the Database.RaisesPlatformEvents interface.



7. Use Inherited Sharing to Secure Your Apex Code
Apex class without a sharing declaration is insecure by default. The sharing is inherited by the caller of the class. For example, if a trigger calls an Apex class and the class has no sharing declaration, then the class runs without sharing because the Trigger always runs in System mode.

You can now specify the inherited sharing keyword on an Apex class, which allows the class to run in the sharing mode of the class that is called it. Using inherited sharing enables you to pass security review and ensure that your privileged Apex code is not used in unexpected or insecure ways.

How: This example declares an Apex class with inherited sharing and a Visualforce invocation of that Apex code. Because of the inherited sharing declaration, only contacts for which the running user has shared access are displayed. If the declaration is omitted, even contacts that the user has no right to view are displayed due to the insecure default behavior of omitting the declaration.





8. Reference Custom Metadata Types in Advanced Formula Fields
Create a custom metadata type, and reference its records in an advanced formula field. Store parameters for your formula in custom metadata types. If you need to make a change, you can do so in your custom metadata type instead of changing multiple, hard-coded formulas.

Let’s say you have several formulas that pertain to wheel sizes. Some formulas perform calculations to confirm that the wheel circumference size is accurate, while others perform vehicle drive-train calculations. If the wheel dimensions for a specific brand change, you can update your custom metadata type rather than the individual formulas.

                      


9. Instantiate Custom Metadata Types in Apex
You can now edit custom metadata records in memory within Apex. Previously, custom metadata records queried with SOQL in Apex were immutable. Audit fields (CreatedDate, CreatedBy, LastModifiedDate, LastModifiedBy, SystemModStamp) and calculated fields remain uneditable. DML operations aren’t allowed on custom metadata in Apex or the Partner or Enterprise APIs. DML operations can be done with the Apex Metadata API.

Below example, the first method is instantiating a custom metadata record, but no records are inserted into memory. The second method retrieves a record, changes it, and returns it to the caller, but the change is not updated in the database.




10. Visual Studio Code is now available for normal orgs (Beta)
Connect to any org to retrieve and deploy sources from Visual Studio Code. Previously, you could use Salesforce Extensions for VS Code only with scratch orgs. Salesforce Extensions for VS Code is the flagship development environment for customizing Salesforce with code. The ability to connect to and develop against any org enables you to start using Visual Studio Code, even if you don’t work exclusively with scratch orgs.

Tuesday, 18 December 2018

Connected App in Salesforce Lightning for 3rd Party Integration

Hi! Glad to see you here!

In this article, we shall learn how we can create a Connected App in Salesforce Lightning when we will  Integrate Salesforce to 3rd Party Application.

First of all, we have to understand What is the Connected App?

A "Connected App" is an application that can connect to salesforce.com over Identity and Data APIs. Connected Apps use the standard OAuth 2.0 protocol to authenticate, provide Single Sign-On, and acquire access tokens for use with Salesforce APIs. In addition to the standard OAuth capabilities supported by the existing Remote Apps feature (which Connected Apps is designed to replace), Connected Apps add additional levels of control, allowing administrators explicit control over who can use the application, and various security policies to be enforced by the application. 
- (Source from Salesforce)

Let's Create a Connected App in Salesforce Lightning for 3rd-Party Integration Step by Step -

Step 1-

Step 2-


Step 3- Fill in all the detail and make sure to mark the "Enable OAuth Settings" checked and Save.


Step 4- After the Save, you will get this window. Click on the "Continue" button.


Step 5-

Thanks for visiting my blog....

Saturday, 24 November 2018

Salesforce Event Dreamin India for Students

Register Now

Get one step closer to attending the biggest Salesforce community event in India.

India Dreamin is a 2-day community-led, community-run event for Salesforce professionals. It has been brought to you by the vibrant Indian Salesforce community and is open to all Salesforce users who share a passion for innovation - developers, admins, partners, customers, and students around the world.

But here we are giving you a chance for Registration only for the Students.

The venue is GL Bajaj College in Greater Noida.

The last date to register is Nov 30, 2018.

The Event date is Dec. 1 & 2, 2018.

So Guys Hurry Up.

Monday, 12 November 2018

Generate QR Code in Lightning for any Salesforce Object

Note - These steps are for the Lightning Environment.

Implement in Salesforce: You need to follow just these steps to create a QR code for an object in Salesforce. So pick any object for this. I have picked the Account object here.

1. Click on the Object Manager tab.
2. Select any Object where you want to create a QR code. I'm using here Account object.


3. Click the "Fields & Relationships" from your left side after that click on "New" to create a new field.


4. Now choose the Formula and click Next.


5. Fill in the field label and choose "Text" as a return type.
6. Paste the formula into the formula box and click Next >> Next >> Save.

IMAGE('https://chart.googleapis.com/chart?chs=200×200&cht=qr&chl=https://cs87.salesforce.com/'&Id ,'Scan QR code to open record in mobile.')
   
Do not use your Lightning Domain Name URL. You have to use only the Salesforce Classic Domain Name URL.

7. Now Open any Account record in your Salesforce Org to show the QR code of the current record.

Saturday, 20 October 2018

Query to get all object of Salesforce


Hi Guys,

Today we will use a snippet code that will get all the object's label names and their values (API) of Salesforce. These label names & values (API) will be standard as well as custom.
So let's try this code snippet in the "Anonymous Log of Developer Console".

1. Go to your developer console and press Ctrl+E from your keyboard to open "Anonymous Window".
2. Paste this code snippet and press the "Execute" button.

1
2
3
4
5
6
7
List<selectoption> getAllObjects = new List<selectoption>();

for(SObjectType getValOfObj : Schema.getGlobalDescribe().values())
{
 getAllObjects.add(new SelectOption(String.valueOf(getValOfObj),getValOfObj.getDescribe().getLabel()));
}
system.debug('debugAllObj'+getAllObjects);

3. Wait while the debug log does not open.
4. Check the "Debug Only" checkbox and see the debug. You will get the object's label & values (API).


5. To verify just go to the "Object Reference for Salesforce" and find here the Label name or values (API).


Thanks to all for reading this blog carefully.

Saturday, 29 September 2018

How to Call Lightning Component from Visualforce Page

Hi Friends,

Today we will learn "How to Call Lightning Component from Visualforce Page". I have added comments on the main code for your understanding. I have used this Vsualforce Page on the Salesforce button.

Let's Start


1.
The button will open under the Contact object.

2. The child object is "Case".

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<apex:page standardController="Case" standardStylesheets="false" showHeader="false">
  <!-- Include a JavaScript file in your Visualforce page -->
    <apex:includeLightning />
       <div id="lightning" />
        <script>
            //"CaseApp" is your Lighning Component App Name (This is mandatory to create App)
            $Lightning.use("c:CaseApp", function() {
              // "c:caseComponent" is your Lightning Component Name 
              // which is using in your Lightning Component App
              $Lightning.createComponent("c:caseComponent",
              {
              //"recordId" - This is your component attribute & "{!Case.Id}" is your Object Id
               "recordId" : "{!Case.Id}",
              },
              "lightning",
              function(cmp) {
                // do some stuff
              });
            });
        </script>
</apex:page>

3. The button code is below.



On our next blog post we will discuss that how to we can call the Lightning Component on the Salesforce Custom Tab. 

Thank You for Come to my blog ....
1. Create Re-Usable Custom Lookup In Salesforce Lightning Component
2. How to Create Custom Lookup In Lightning Component

Saturday, 22 September 2018

How to bind fields as Output in Lightning Component


Hi, friends and Gurus,

Welcome to my SFDC4Students blog.

After a long time, I came up with Lightning Component in Salesforce. Today we will discuss how to bind fields as output in Lightning Component. This is a very simple code that I give you. So let's go.

This is the design of our Lightning Component.
clsSimpleSignProcessTemplateComponent

Step 1 - Create A Class named "fetchOrgInfoController" to get the Org data.

1
2
3
4
5
6
7
8
9
public class fetchOrgInfoController{
    @AuraEnabled
    public static Organization fetchOrgInfo()
    {
        // Query on "Organization/Company" object and get the fields which you want to show on your Lightning Component
        Organization objOrg = [SELECT City,Country,Name,PostalCode,Street FROM Organization limit 1];
        return objOrg;
    }   
}

Step 2 - Create Lightning Component named "SFDC4StudentsOutput"

Step 3 - Create a JavaScript Controller named "SFDC4StudentsOutputController"

1
2
3
4
5
6
({
    // This JavaScript Controller function will call the Helper named "onloadHelper"
 onload : function(component, event, helper) {
  helper.onloadHelper(component, event, helper);
 }
})

Step 4 - Create a JavaScript Helper named "SFDC4StudentsOutputHelper"

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
({
    // This JavaScript Helper function will call the Apex method named "fetchOrgInfo"
 onloadHelper : function(component, event, helper) {
        // Call the Apex Method
  var action = component.get("c.fetchOrgInfo");
        
        // The response code start which verify that the Apex Method has called successfully
        action.setCallback(this, function(response){
            if(response.getState() === "SUCCESS") {
                // "orgInfo" is the Component attribute which hold the Apex Method return value
                component.set("v.orgInfo",response.getReturnValue());
             }   
        });
        // $A.enqueueAction(action) adds the server-side controller action to the queue of actions to be executed.
        $A.enqueueAction(action);
 }
})

Step 5 - Create an App named "SFDC4StudentsOutputApp"

1
2
3
<aura:application extends="force:slds">
    <c:compSFDC4StudentsOutput/>
</aura:application>

Please develop this Component from your side, when you write a code yourself then you can learn else copy paste doesn't mean.

In the next post, we will discuss some points of Lightning Component that you have to need to know.

Thanks for come to my Blog. If this post is helpful to you then share and follow to get new coming SFDC4Students blog posts.

Tuesday, 26 June 2018

Why can't we create a master detail relationship? (The 3rd reason)

Why can't we create a master-detail relationship?

1. Some reasons are, but what is the 3rd reason, Like-
         a) Salesforce will not accommodate a master-detail relationship to a custom object that 
             already contains data.
         b) You can create a maximum of 2 master-detail relationships.
               
The situation which I face -
2. I have only one master detail relationship on an object. But I'm not able to create a new master-detail relationship on the same object.

Guess Why....
Let's know the situation with an example -



3. I have another object named “Test B” where an MD relationship of the object “Test A”.


>> Both the above two reasons are failing here.

So why…

Reason You can’t create this type of field because a master-detail relationship already exists on this object and this object is the master in another master-detail relationship.

Note You can show this above conclusion message at that time when you create another MD relationship field on object “Test A”.

This may be helpful to the new SFDC Students…
Thanks for reading my post.

Friday, 23 March 2018

How to you can give the permission of all fields of an Object to a profile on a Single Click.

Hi All,

I have a question for all of you regarding Salesforce FLS, Object level, Tab, and App level security.

How you can give permission for all fields of an Object to a profile or it may be more than a single profile.

From my point of view that just go to the Profile then select an object from Field Level Security Section and then true/false the checkbox of “Read Access” or “Edit Access” one by one. It will take a too long time. Am I right?

Just imagine, Is this possible with a single click?

I think your answer, No or I don't know or Not Sure, or other answers.

Is it possible?
Answer – Yessss

Just read my this blog carefully, and if this is good for your time save then share and comment, please.

Let’s come with me…

Use the "CRMSCIENCE".

CRMSCIENCE - It is a Google Chrome Extension that provides the facility to give Access to Fields, Tabs, Objects, and more to a profile with a single click.

Here I tell all of you how it works for the FLS (Field Level Security).
Get Ready,

Step 1. Install the "CRMSCIENCE" extension on your Google Chrome browser.
           
             Click here - CRMSCIENCE for Salesforce

Step 2. Go to Your Profile from -- 
             Type "Profile" in Quick Find Box then select your profile which you want to give the FLS of the object.
             Scroll down and choose your object for FLS.


Step 3. Click on the "Edit" button and do as per the picture say.




Step 4. Save.

That's All....
Thanks for R&D...

Monday, 12 March 2018

How to we see Record when we Hover on a lookup field in Salesforce Lightning

Do you know how to see Record when we Hover on a lookup field in Salesforce Lightning?
Requirement –
I have an Object name “Car Brand” – (Master Object) and this object has the Lookup of “Car Model” – (Child Object). And I want to see the ‘Car Model’ object’s fields when I’m on the ‘Car Brand’ object using hover.

When I open a record and go to its Related List and hover the mouse on the lookup field then I want to see some fields of the Related object.


Let’s Come with Me and configure it because it’s Easy and Understandable.

Step 1 – Go to Setup >> Object Manager


Step 2 – Click on Object Manager >> (Type your object name which you want to see the field on the time of hover) >> Click on your object name.



Step 3 – Click on the Compact Layout >> New (Button).


Step 4 – Insert the Label and Choose the fields which you want to see in hover time.


Step 5 – Click on the ‘Compact Layout Assignment’ then ‘Edit Assignment’ and choose your own created Compact Layout as ‘Primary Compact Layout’ and Save.

Now, Open your Record and see the fields which you want to show on Hover Time.


Finally, we had done it but now come to the Remember Things.  
1 - Only 4 fields we can see on the Hover Time.
      2 - Always when you choose fields, keep important fields at the top.

*    Is this helpful for you? If yes then comment fast.....

Sunday, 25 February 2018

Entitlement Management in Salesforce - Session 1

Hi Guys, there is the the time of "Entitlement Management" in Salesforce. Limited time but more knowledge in short. Let's Go.
























Total Pageviews