Wednesday, 21 February 2018

Dynamic Input Form from fieldsets with Lightning Component Salesforce

Following component will useful when you want to display the form fields by reading dynamically from the field sets and the following code supporting saving multiple records at a time.


Friday, 16 February 2018

Alternative to ligtning:icon in Lightning Component (Reusable SVG Lighting Component)

Multiple rows with close option should be displayed. On click on close icon beside a specific row it should be cleared. There is a need to give index for the icon if you use lightning:icon you cannot assign dynamic id as aura:id won't support dynamic value.

To achieve the above requirement it should be a html button/ html icon. To should the svg icon without using lighting:icon following approach will be helpful.

Reusable Lighting Component for svg icon -
Usage for the above component -
Go to LightingDesignSystem Website > Icons > save as the icon in IE browser (It should be saved in svg format). You can open the file in note pad and copy the pathd.

Friday, 9 February 2018

Apex Method to convert json format records into List of Sobject Records format

The following method will be useful when you are supplying list of records as input to the Apex Method.

1. Passing List of Sobjects to the Apex Method from the Lightning component is not allowed.
2. you should convert Sobject list by using JSON.stringify(yourSobjects) and the Apex method input should be string.
3. The following method will be useful to convert above json fromat string into List<Sobject>

Please find the following Code -

Thank You,

Tuesday, 19 December 2017

Selecting multiple values from a Picklist in Lightning Component

All the credit goes to below blog post -

As I am not able to get the result immediately and spent sometime to figure out few issues, I am posting my version which might help some of you.
Server Classes -
Custom Event to fire -
Reusable component -
Using the above component -

Hold the 'Shift' key to select the multiple values.

Friday, 15 December 2017

Sorting the cloumns in Datatable while working with Lightning Component

I am giving the simple idea to implement the sorting functionality for the datatable.

Create the following Apex Class -
Create the following Lightning Component -
Create the following Lightning Controller Js - Create the following Lightning Helper Js - Create the following Lightning App in which you can see the preview for the above created component - I still didn't work on showing the up and down arrows which I might work in future. (Please comment if you want that functionality to add, with some response it will be encouraging me to work on that part as soon as possible.)

Friday, 1 December 2017

Quick Action to Update a Record in Lightning Experience (Alternative to Custom Button in Salesforce Classic)

In this example I going to explain about create a custom action by overriding it with 'Lightning Component Bundle'.

Create the Apex Class to update the Contact -

Create the following Lightning Bundle -
Steps to Create Quick Action -

after saving add to the Lightning Quick Actions in Contact Page layout as shown below -

after saving if you switch to lightning experience you should be able to see as shown below -

as per the above screenshot level is blank, upon clicking on "Update Contact" Action it will be updated to Primary.

Close the above window and refresh the page you should see contact "Level" as "Primary".

Monday, 22 May 2017

Salesforce Certified Developer – Spring ’17 Release Exam

1. Who can edit a user's favorites in Lightning Experience?
A. The system administrator
B. The user
C. The user's manager
D. Any user in the same profile
Ans: B
2. Which three actions does the Global Action Menu Support?
Choose 3 answers
A. Create records
B. Take notes
C. Create posts
D. Launch Visualforce
E. Delete records
Ans: A, B, D
3. When an old post with a file is shared in Lightning Experience, what happens to the file in the newly shared post?
A. The file is attached to the new post
B. A link to the old post is shared.
C. The file is not shared in the new post.
D. A link to the file is shared.
Ans: C
4. How many duplicate account records can be merged in Lightning Experience at once?
A.Up to 5
B.Up to 6
C.Up to 10
D.Up to 3
Ans: D 
5. Which three predefined values can be set with send email action?
Ans: A, B, C