Soql query to get company/organization Id in salesforce - Salesforce Globe For You
Solution: Select id,name from Organization
A blog containing Salesforce coding examples in detail.It's a place where you can find solutions to the problems that you may face in your daily salesforce coding. Apex classes,visual force page,we services,Integration,plugins,extensions,Lightning web components,Aura components,Email Messages,Sales cloud,service Cloud,Marketing Cloud.Lightning Web components,salesforce.com, Salesforce Tips and Tricks,short cuts,ApexMocks,Stubs, visibility,Salesforce Shorts
Soql query to get company/organization Id in salesforce - Salesforce Globe For You
Solution: Select id,name from Organization
How to retrieve validation rules using package.xml in vs code salesforce - Salesforce Globe For You
Problem: Assume a validation Mobile_Number_Required is written on the Lead object.Now we need to retrieve that validation rule in vs code tool using package.xml
Solution: Use name as ValidationRule and member as objectName.validationName as shown below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata"><types>
<members>Lead.Mobile_Number_Required</members>
<name>ValidationRule</name>
</types>
<version>48.0</version>
</Package>
Output:
How to iterate a list in lwc component Salesforce? - Salesforce Globe For You
Solution: Use for:each attribute to iterate the list in lwc component.
Example:
iterateListInLWC.html
<template>
<lightning-card title="Following are the months present in a year" icon-name="custom:custom14">
<ul class="slds-m-around_medium">
<template for:each={months} for:item="month">
<li key={month.Name}>
{month.Name}
</li>
</template>
</ul>
</lightning-card>
</template>
iterateListInLWC.js
import { LightningElement } from 'lwc';
export default class IterateListInLWC extends LightningElement {
months = [
{
Name: 'January',
},
{
Name: 'February',
},
{
Name: 'March',
},
{
Name: 'April',
},
{
Name: 'May',
},
{
Name: 'June',
},
{
Name: 'July',
},
{
Name: 'August',
},
{
Name: 'September',
},
{
Name: 'October',
},
{
Name: 'November',
},
{
Name: 'December',
},
];
}
iterateListInLWC.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>50.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>
Output: