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

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:{!API.Session_ID}


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

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



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)


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