You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to get the RecordType/Id Name of Account Object based on AccountId and Assign the Record Type Name to Lightning Component Uses of Aura:If Condition in Salesforce
#42
Open
vijayk3327 opened this issue
Aug 20, 2023
· 0 comments
In this post we are going to learn about How to get the RecordType/Id Name of Account Object based on Record Id and assign the Record Type Name to Lightning Component Uses of Aura:If Condition in Salesforce.
In this post we are going to learn about How to get the RecordType/Id Name of Account Object based on Record Id and assign the Record Type Name to Lightning Component Uses of Aura:If Condition in Salesforce.
👉 To get source code live demo link, Click Here.
Create Lightning Component
Step 1:- Create Lightning Component : recordTypeAccountCmp.cmp
`<aura:component controller="recordTypeClass" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordTypeId" type="String" />
<aura:attribute name="fields" type="String[]" default="['Name','AnnualRevenue','Industry','Refer_Code__c','RecordType']" />
<aura:attribute name="recordId" type="String"/>
Account Record Type = {!v.recordTypeId}
</aura:component>`
Create Component JavaScript Controller
Step 2:- Create Lightning Component : recordTypeAccountCmpController.js
({ doInit : function(component, event, helper) { helper.recordTypeHelper(component); }, })
Create Component JavaScript Helper
Step 3:- Create Lightning Component : recordTypeAccountCmpHelper.js
`({
recordTypeHelper : function(component, event, helper) {
var action = component.get('c.recordTypeId');
action.setParams({"recId":component.get("v.recordId")});
})`
Create Apex Class Controller
Step 4:- Create Apex Class : recordTypeClass.apxc
`public class recordTypeClass {
}`
👉 To get source code live demo link, Click Here.
The text was updated successfully, but these errors were encountered: