I am having a picklist field as like below in details page and I am trying to convert this record into opportunity. For that I created one Link inside under "Button,Links and Actions" and calling the opportunity inside it like this /lightning/o/Opportunity/new?defaultFieldValues= and in oppurtunity I am having one checkbox field Activism_cb.

Until here things are fine but I am creating a formula as

Activism_cb__c ={!IF( ISPICKVAL(M_A_Lead_Tracker__c.Type__c, 'Activism') , TRUE, FALSE)}

enter image description here

enter image description here

But the checkbox is not getting selected. Even I tried like this

Activism_cb__c =If( text((M_A_Lead_Tracker__c.Type__c) =='Activism' , false ,true)

and even simple thing itself is not working

Activism_cb__c =true

enter image description here

2 Answers 2


In the URLFOR function, everything must compile to a string, because all URLs are essentially sent as strings that are then later parsed into typed variables and values.

So to fix your issue, you just need to make sure that you not actually send a Boolean value (as the error says) but sending a string representation of that ('true' rather than true)

Change you URLFOR calc to this:

{!URLFOR('/lightning/o/Opportunity/new?defaultFieldValues=Approved__c=' + IF(TEXT(M_A_Lead_Tracker__c.Type__c) == 'Activism' , 'false' ,'true') )} 

Formula values are calculated on the fly when you view or query the record.Formula fields are not writeable it is always derived by the expression. You can do something like below you need to adjust your condition accordingly

{!URLFOR('/lightning/o/Opportunity/new?defaultFieldValues=' + IF(ISBLANK(Contact.AccountId), ", ',AccountId='+Contact.AccountId) )}
  • If i give like this {!URLFOR('/lightning/o/Opportunity/new?defaultFieldValues=Activism_cb__c=true')} then working fine but if give like this {!URLFOR('/lightning/o/Opportunity/new?defaultFieldValues=Activism_cb__c='+If( text(M_A_Lead_Tracker__c.Type__c) =='Activism' , false ,true) )} I am getting error as Error: Incorrect parameter type for operator '+'. Expected Text, received Boolean Can you help me what is wrong?
    – klnavi
    Commented Jun 22, 2021 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .