Salesforce : Consultant Tip's 2024
Salesforce : Consultant Tip's 2024
Many people are requesting to show all the tips as a web page so they can easily checkout for your usages so I'm creating a blogger for my followers and friends. :
-
Tip of the week # 162 : Deploy Metadata Using REST API.
Description : SDeploy using the deployRequest REST resource to initiate a request that handles all operations for the deployment.
You can deploy or retrieve up to 10,000 files at once. AppExchange packages use different limits: They can contain up to 35,000 files. The maximum size of the deployed or retrieved .zip file is 39 MB. If the files are uncompressed in an unzipped folder, the size limit is 400 MB.EndPoint : https://host/services/data/vXX.0/metadata/deployRequest Format : JSON Method : POST Authorization: Bearer token -
Tip of the week # 161 : Styling Hooks for LWC.
Description : Styling hooks use CSS custom properties which make it easy to customize component styling and express your brand, especially when working with web components and shadow DOM.
Snapshot of Code : For LWC Component (Create component with CSS file) : HTML :
CSS :
Note : Styling hooks are constructed using CSS custom properties. (also referred to as CSS variables or cascading variables.lightning-button.button { --sds-c-button-brand-color-background: #bb00ff; --sds-c-button-text-color: #f4f7f9; --slds-c-button-brand-color-border: #bb00ff; } -
Tip of the week # 160 : Create Util CSS class for LWC.
For CSS Component (Create new LWC component with name importCSS and remove all component and Create CSS file in LWC) :
importCSS.css
For LWC Component (Create component with CSS file) :.buttonShadow{ box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset; } .buttonBrand{ background-color: #081567; border-color: #081567; } .buttonDestructive{ background-color: #970b06; border-color: #970b06; } .buttonSuccess{ background-color: #155a3c; border-color: #155a3c; }
HTML :
CSS :
Note : CSS component just need CSS file only.@import "c/importCSS"; -
Tip of the week # 159 : Dataset property for getting from UI.
HTML Template
JSName: {account.Name} flag: {account.flag} type: {account.Type}
Note : for accessing dataset from LWC (UI component), you have to use data-(Property Name) then you are able to get via events.handleClick(event){ console.log(event.target.dataset.name); }
-
Tip of the week # 158 : Field import in LWC and get value without Query.
Note : Dynamic import are referenced so if anyone tries to delete the field then it will show an error message and show in the reference list.public class PickListOptionsController { @AuraEnabled public static List
getPickListOptionList(String objectName, String picklistFieldName){ List picklistOptionList = new List (); Schema.SObjectType convertToObj = Schema.getGlobalDescribe().get(objectName); Schema.DescribeSObjectResult res = convertToObj.getDescribe(); Schema.DescribeFieldResult fieldResult = res.fields.getMap().get(picklistFieldName).getDescribe(); List ple = fieldResult.getPicklistValues(); for( Schema.PicklistEntry pickListVal : ple){ picklistOptionList.add(pickListVal.getLabel()); } return picklistOptionList; } }
Zordial offers Salesforce implementation services, consulting and managed services in India. Get expert guidance from top Salesforce implementation consultants.
ReplyDelete