Monday, April 9, 2018

Lightning Custom Combobox with Searchable Options

        The custom Lightning Compobox,  which has the ability to search the predefined  options. This can also able to take the typing values which are not in the predefined options. The custom validation also managed.

The screenshots

The Code

Friday, March 16, 2018

Salesforce Lightning - inter namespace component communication

There is a challenge to integrate lightning components from different managed packages. There raised a question "Are the communication between the components from different namespace is possible ? "

As per my understanding, I confirmed yes;  but others are not satisfied on that. So we have raised a case for Salesforce support and  described our problem to them. They confirmed that inter namespace communication is not possible in locker service.

Since I have still doubted on that, I done a POC with different namespaces.

I have created a parent component with two attributes in one org (namespace1) and created a child component in another org (namespace2). I have integrated both of them with Javascript.  The two packages are created from both of the orgs and installed in a 3rd org.

In the 3rd org, I can success fully run the application by passing attribute values from parent component (namespace1) to child component (namespace2) also using the events I passed the data back from child to parent componet.

So I can confirm, the communication between lightning components which are in different namespace is possible, rather than the Salesforce support.

Its my experience !!!

Thursday, March 15, 2018

Salesforce Lightning : Dynamic Custom labels in lightning components

Custom labels are used in Salesforce to present the information which are not available in database not part of data records. For eg: the page headings, button labels, help text etc... The custom labels gives an option for developers to present multilingual information  based the end used language. The mail application areas of custom labels are the Visualforce pages & Lightning components.

Custom labels in lightning components 

The custom labels are included in Lightning components as :
  • {!$Label.c.labelName} for the default namespace
  • {!$Label.namespace.labelName} to access a label in a managed package
Else we can use the javascript method :
  • $A.get("$Label.c.labelName")
  • $A.get("$Label.namespace.labelName")

Dynamic Custom labels in lightning components

In some situations  we have to dynamically include the Custom labels on the go.  ie we can only be able to determine the label name on the run time.  The below component will help to get the dynanic label values on the run time

Friday, February 16, 2018

Salesforce Lightning : The MVCC Platform

            The Salesforce is a known cloud platform which is run under Model View Controller (MVC) architecture.  For the Salesforce,  the MVC is:

                          Model :-  The Salesforce Data objects (Sobjects)
                          View :-  Visual force markups and HTML tags
                          Controller :- The apex code which driven the business logic's. (Apex class)

The Salesforce Lightning Platform

                      The Salesforce lightning platform is for building an interactive user experience. We can build highly interactive and fast responsive user interfaces with this new platform. The platform defines a set of directives (SLDS) to build responsive UI. The business logic is divided among two controllers for the fast processing.  The Javascript controller which runs in browser, do the 60% of business logic.  The Javascript controller communicates to the Apex controller (Server side controller) if its really required a server side processing or any other data operations from the Model (Sobjects). The View is communicating only with the Javascript controller likewise the Model is communicating only with the Apex controller. We can say, the Lightning is a MVCC platform since it has two controllers which share the business logic.

                                   Model :-  The Salesforce Data objects (Sobjects) 
                                   View :-  Aura markups and HTML tags with SLDS
                                   Controller :- The JavaScript controller that communicate with View
                                   Controller :- The Apex controller that communicate with Model