EDIT: You already are in the "merge fields syntax" with the {!IF ... }
. There's no need to use { ... }
again inside this IF but you have 'CF{!URLENCODE...
So probably something like this will be better:
<apex:outputLink
value="/{!relList.keyPrefixObject}/e?{!IF(relList.contactParameterId != null, 'CF' & URLENCODE(relList.contactParameterId) & '=' & URLENCODE(contact.Id),'')}&retURL=/{!contact.Id}&saveURL=/{!contact.Id}">
</apex:outputLink>
(you probably also don't need to URLENCODE anything here, both field Ids and record Ids should be "safe")
I don't think you're doing anything wrong.
Server-side parser gets in my opinion stupid overzealous with URLENCODE'ing too much stuff you'd consider safe. Might be even related to my question Proper urlencoding of spaces in formulas syntax
I have a massive <apex:commandButton />
to redirect user from my overridden VF page to standard edit page while salvaging what I can (prepopulating some fields) if he needs to fall back to original behavior of the page.
<apex:commandButton value="classic 'new' page"
immediate="true"
action="{!URLFOR($Action.Purchase_Order_Item__c.New, $ObjectType.Purchase_Order_Item__c,
[retURL=URLFOR($Action.Purchase_Order__c.View, po.Id),
saveURL=URLFOR($Action.Purchase_Order__c.View, po.Id),
CF00ND0000003F2Gk_lkid=po.Id,
CF00ND0000003F2Gk=po.Name,
CF00ND0000003F2Gn_lkid=po.Cost_Code__c,
CF00ND0000003F2Gn=po.Cost_Code__r.Name,
CurrencyIsoCode=po.CurrencyIsoCode],
true) + '&00ND0000003F2Gw=' + po.PO_Type__c + '&00ND0000003F2Gv=' + po.PO_Sub_Type__c}"
rendered="{!Purchase_Order_Item__c.id = ''}" />
po
is the "Purchase Order" header and this button sits on the page we use to create new line items.
As you can see this abomination deals with your "CF" problem outside of URLFOR
. Additionally fields with names that begin with 0
will prevent you from saving the VF page so I had to put them outside of the URLFOR
too (they're picklists if that's relevant).