Posts

Showing posts with the label AuraFramework

Building Generic Lightning Component (Custom Clone Functionality)

Image
In this blog I am going to tell you about writing generic Lightning Component which helps to reduce your effort. It is definitely going to take more effort to write generic component but just think about what will happen once you will finish your Lightning Component. It will save lot of your effort in future. So the question is why generic component takes more effort than specific Lightning Component. The answer is we need to think about every possible scenarios. Let's take one simple requirement. Requirement:  Build a generic Clone functionality on Account Object which copies only specific field's data of a record instead of all fields. Step 1: So the requirement is specific to Account Object so lets start building a Custom Lightning Component. To implement clone functionality first I will create a Lightning Component in which I will use force:createRecord method to create new record and in force:CreateRecord we have attribute which can auto-populate fields. So ...

Redirect To Custom Page after Record Creation in Lightning

Image
As we know that in Salesforce Lightning there is no direct way to override Save button and redirect to new custom page after creating record from Standard Record creation page. This blog may help you redirect to new Custom Lightning Page after creating record. Requirement:   I want to redirect to a custom page after creating any record. Redirection should not work if record is getting updated. Solution 1:   If Page Layouts do not have lot of fields then create new Lightning Component with Custom Save Button. But cannot use Lightning Data Service because LDS does allow to override Save Button. Solution 2: But what if Page Layouts have 100s of fields. Now it's not possible to create a Lightning Component and add all fields on that Lightning Component. For this situation we have a work-around. Below are the steps need to perform for this requirement: Create a custom Field. Let's call it  isCreated . Data Type - Checkbox By default value of this T...

Followers