Skip to main content

Posts

Showing posts from June, 2023

How to redirect to the newly created record from standard 'Create a Record' quick action button ?

  H ow to redirect to the newly created record from standard 'Create a Record' quick action button ? In this blog we will see how we can navigate to New Record created from Standard 'Create a Record' Quick Action.  Implementation and Use Case:  Use Case: We have a button Create Contact which is a 'Create a Record' quick Action on Account object record page and on click of which when the record is created we need to navigate to the new record created automatically.  Implementation: Create a Record Quick Action does creates the new record but it doesn't really navigate to the create record. It only shows us the success toast message that record is created. Now since it is standard quick action we don't have anything to update or change right to make it navigate. So, as a work around we can make this happen by creating a new empty aura component.  In this Aura Component we will use force:showToast event to fetch the new recordId and then use force:navigate

How to get sObject Tab Icon dynamically in Salesforce Apex Class ?

  How to get sObject Tab Icon dynamically in Salesforce Apex Class ? In this blog we will se how we can get sObjects TabIcon Name dynamically. Implementation and Use Case: Use Case:- If we need to select a sObject from a given list of sObjects and then show the Icon for the selected sObject. Pass a sObject name and show the Icon name in Lightning Card. Implementation:- Code snippet:- /**  * @description       : Set Icon Name/URL  * @author            : Amit Agarwal  * @last modified on  : 04-06-2023  * @last modified by  : Amit Agarwal **/ public with sharing class SObjectIconController {     public static String getIconName ( String sobjAPIName ) {                 String iconName ;         List < Schema . DescribeTabSetResult > descTab = Schema . describeTabs ();               for ( Schema . DescribeTabSetResult dts : descTab ) {             List < Schema . DescribeTabResult > tabs = dts . getTabs ();                     for ( Schema . DescribeTabResult tab