Hello everyone,
In this post, we will see how to conditionally render an LWC component & a Standard New Page from a ListView.
In this example, we will render an LWC & Standard Page based on Logged In User Profile.
Now let's jump into the steps.
- Click on the Gear icon and navigate to Salesforce Setup.
- Select the Object you want to customize the standard button.
- Now click on the Buttons, Links & Actions.
- Select New Button & Link.
- Select the Display type as List Button (i.e Button which is for ListView) along with content Source as URL.
- Now use the formula given below
{!IF( $Profile.Name !='System Administrator',URLFOR("/lightning/cmp/c__SampleLWC", null, null),URLFOR($Action.Account.New))}