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
SFRichSFRich 

Custom Label with SOQL

Has anyone been able to reference a 'Custom Label' value in a SOQL WHERE clause?  I doubt it's possible but I thought I'd ask.  I've had success referencing a custom label field in a Salesforce Custom Button URL for Conga Composer.  The value of the Custom Label field gets passed into a Conga Query as a parameter:

 

Button URL to call Conga Composer and execute Conga Query with Where clause parameter:

https://www.appextremes.com/apps/Conga/PointMerge.aspx?sessionId={!API.Session_ID}
&serverUrl={!API.Partner_Server_URL_80}

...

&QueryID=[WPGrowth]a0LV0000000XX91?pv0=" '{!Account.Branch_Grouping_Code__c}' AND

Year__c = '{!$Label.Financial_year}' "  

 

Rahul_sgRahul_sg

You can assign a label to any local variable and then use that varibale in SQOL query.

 

e.g.   integer days = integer.valueof(Label.labelname)

sandeep@Salesforcesandeep@Salesforce

In query in salesforce you can access label neither in SOQL not  in it's where clause.