Wednesday, December 11, 2019

How to disable task notification when task is assigned to the user in salesforce

Go the user personal settings, enter Activity Reminders in the Quick Find box, then select Activity Reminders.
Deselect Email me when someone assigns me a task.


Monday, December 2, 2019

How to make default Landing Page as Setup page in Salesforce

To make the default landing page as setup page, go to the 'Advanced User Details' of the user and enable the 'Make Setup My Default Landing Page' permission.


Sunday, December 1, 2019

How to get Picklist values based on record type in Lightning Web Components(lwc)

To get picklist values based on record type we have to use getPicklistValuesByRecordType wire adapter.
Syntax
import { getPicklistValuesByRecordType } from 'lightning/uiObjectInfoApi';

In this demo, I am using Account object, based on record type id I am getting picklist values of Industry field

HTML Code
<template>
    <lightning-card title="Picklist Vlaues based on Record Type">
      <div if:true={options}>
            <lightning-combobox name="progress"
                                label="Industry"
                                value={value}
                                placeholder="-Select-"
                                options={options}
                                onchange={handleChange} ></lightning-combobox><br/>
        
            you selected industry: <b>{value}</b><br/><br/>
      </div>
    </lightning-card>
    
</template>

Javascript Controller
import { LightningElement, track, wire} from 'lwc';
import { getPicklistValuesByRecordType } from 'lightning/uiObjectInfoApi';

export default class PicklistValuesByRecordType extends LightningElement {
    @track value;
    @track options;

    @wire(getPicklistValuesByRecordType, { objectApiName: 'Account', recordTypeId: '012B0000000gTUOIA2' }) 
    IndustryPicklistValues({error, data}) {
        if(data) {
            this.options = data.picklistFieldValues.Industry.values;
        }
        else if(error) {
            window.console.log('error =====> '+JSON.stringify(error));
        }
    }

    handleChange(event) {
        this.value = event.target.value;
    }
}

Output