function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC GuestSFDC Guest 

Use custom meta data picklist values in if condition using apex

Hi All,
I have created custom meta data account_mdt with picklist field "Category", with two picklist values. they are "Avaialbale" and "NotAvailable". I want to use these picklist values in below if condition. plz provide the syntax

if(Account.Type==(here i want to use account_mdt.category.Available value') 
Here, standard object "Account" type is equal to value of custom meta data account_mdt with picklist field "Category" - value=Avaialbale.
SFDC GuestSFDC Guest
In simple words, account type picklist is having two values. they are 'available' & 'nonavailable'.
another object-contact is having picklist field contacttype with values 'available' & 'nonavailable'.
now if (acctype==contacttype) then do some process.
i want to compare picklist values of two objects.
If i have undesrtood correctly, Please try below.

if (acctype.equalsIgnoreCase(contacttype)){
// put other code

Pawan Kumar