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
sfadm sfadmsfadm sfadm 

How to set picklist value in URLFOR?

I'm trying to set a picklist value in URLFOR.

I have a custom button and when the button is pressed the following javascript is executed:
window.parent.open("{!URLFOR( $Action.Custom_Object__c.New,null,[CF00M0N00000OpQRx = Account.Name, CF00NK0000001jyxH = {!URLENCODE(TEXT(Account.Schedule__c))}, CF00N2a000000b34C = Account.Custom_Number_Field __c])}", "_self");
In the first scenario:
CF00NK0000001jyxH = ''
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the second scenario:
CF00NK0000001jyxH = Account.Schedule__c
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the third scenario:
CF00NK0000001jyxH = TEXT(Account.Schedule__c)
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the forth scenario:
CF00NK0000001jyxH = {!URLENCODE(TEXT(Account.Schedule__c))}
I receive the following error:
Error: Syntax error
Could you please advise how to set a picklist value in URLFOR function?




 
Rishab TyagiRishab Tyagi
Hello sfadm,

Just to confirm you were using the following format in the third scenario:

CF00NK0000001jyxH = {!TEXT(Account.Schedule__c)}
instead of
CF00NK0000001jyxH = TEXT(Account.Schedule__c)