How to use namespace in managed lightning components If you are working on a lightning component and it’s going to be a part of a managed package then you need to take care of namespace in client side JS code if you are accessing any custom field. This can be handled in various ways but […]
Calling a child lightning component method from the parent lightning component When we have multiple nested components then we may run into a scenario in which our parent lightning component is supposed to call a method of its child component. This is a very common use case. simplifies the code needed for a parent component […]
Adding Loading Icon on the page for an AJAX Request ( ActionFunction, CommandButton) It’s always good to add a loading icon on the page when you are processing something on the server side (calling an apex method ) so a user can understand that something is running in the background. Following code snippet can be […]
Uploading Attachment from Non-Salesforce Users ( Site or Guest Users) through Force.com sites I came across a question on Trailblazers community where someone asked for a way to upload an attachment to a record and it should be accessible by non-salesforce users. I won’t go into much detail about that and will focus on providing […]
Never store record’s Id as a String (Variable type) if you are comparing Ids in your Apex code If you are writing apex code then make sure that you are treating Ids’ carefully. You should emphasize on declaring your variables of Id-type instead of String since storing record Id in a variable which type is […]
If you are using Lightning Experience then you must be waiting for some key features to roll out in LEX as they are very crucial for your business. Salesforce Product Team is working very hard to deliver things asap but it’s always very hard to deliver all the features due to time constraint. I came across a […]
Having trouble with and components? Then why don’t you use Jqyery Datepicker? Jquery datepicker gives a lot of flexibility and freedom to developers to let them use a datepicker as per business needs. A developer can enforce validation on dates and date range which is very hard to impose using these out-of-the-box components as they rely […]
If there is a need of scheduling an apex job or schedulable apex class after each hour then cron expression is the best way. Cron expression allows you to schedule a job on a specific time. Following cron expression runs a job after each hour of the day. [code language=”java”] scheduledJob j = new scheduledJob(); […]
Accessing record ID in the Lightning component is very simple. Just use following things. Implements force:hasRecordId interface in the component as follows. <aura:component implements=”flexipage:availableForRecordHome,force:hasRecordId” access=”global”> Define an aura:attribute as follows. <aura:attribute name=”recordId” type=”String” description=”The ID of the record to be displayed. Provided by force:hasRecordId interface.”/>