Wednesday, 4 May 2022

How to navigate to Standard Edit record page LWC

 Hi,

The following code snippet helps to navigate to the Standard edit record page.


Code Snippet:

 this[NavigationMixin.Navigate]({            

                        type: 'standard__recordPage',

                        attributes: {

                            recordId: this.recordId,

                            objectApiName: 'Account',

                            actionName: 'edit',        

                        },

        

                        state: {

                            nooverride: 1,

                            backgroundContext: '/lightning/r/Account/' + this.recordid + '/view'        

        

                        }

        

                    });

                    eval("$A.get('e.force:refreshView').fire();");

}


Reference: 

https://developer.salesforce.com/docs/component-library/overview/components


How to auto populate default values when New button is overridden with lwc

 Hi,

The following js code snippet helps to auto-populate values when the New button is overridden.


Code Snippet:

 

 const defaultValues = encodeDefaultFieldValues({

                        Name: 'Salesforce Techbook Foundation',                       

                    });                         

                    this[NavigationMixin.Navigate]({

                        type: 'standard__objectPage',

                        attributes: {

                            objectApiName: 'Account',

                            actionName: 'new'

                        },

                        state: {

                            nooverride: '1',

                            recordTypeId: this.recordtypId,

                            defaultFieldValues: defaultValues

                        }

                    });

eval("$A.get('e.force:refreshView').fire();");


Reference : 

https://developer.salesforce.com/docs/component-library/overview/components

Tuesday, 3 May 2022

Main Components to be retrieved for deploying a Community

 Hi,

When we have to deploy a community to another Salesforce org that is not connected then the following components have to be retrieved along with the other necessary components like Apex Classes, Visualforce page, Aura, etc., based on our project.

 <?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

  <types>       

        <members>*</members>

        <name>ContentAsset</name>

    </types>

    <types>       

        <members>*</members>

        <name>CustomSite</name>

    </types>

    <types>       

        <members>*</members>

        <name>Audience</name>

    </types>

    <types>       

        <members>*</members>

        <name>Network</name>

    </types>

    <types>       

        <members>*</members>

        <name>SiteDotCom</name>

    </types>

     <types>       

        <members>*</members>

        <name>NetworkBranding</name>

    </types>

     <types>       

        <members>*</members>

        <name>CustomSite</name>

    </types>

    <types>

        <members>*</members>

        <name>Profile</name>

    </types>    

     <types>

        <members>*</member>

        <name>CustomLabel</name>

    </types>

    <types>

        <members>*</member>

        <name>Flow</name>

    </types>

    <types>

        <members>*</member>

        <name>Community</name>

    </types>

    <types>

        <members>*</member>

        <name>CommunityTemplateDefinition</name>

    </types>

    <types>

        <members>*</member>

        <name>CommunityThemeDefinition</name>

    </types>

  <version>53.0</version>

</Package>


Reference:

https://developer.salesforce.com/docs/atlas.en-us.220.0.communities_dev.meta/communities_dev/networks_migrate_overview.htm

What’s the difference between Einstein Article Recommendations and Suggested Articles?

How Does Einstein Article Recommendations Work? Einstein Article Recommendations helps support agents resolve customer cases efficiently by ...