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
Pat VachonPat Vachon 

List Button URL won't work with community users due to URL encoding of forward slash

This URL works fine w/ my enterprise users but not so with my community users as they have "sales/" at the beginning of their relative URL. In theory this works, except the forward slash is being encoded to %2F. Does anyone know of a way to suppress/disable encoding the forward slash? If not, what is the next easiest way to implement this requirement of custom URLs that work with both enterprise and community users.

/{!IF( User.Profile="Sales (Part Comm)", "sales/" , "")}a1Y/e?
&CF00N9000000AnnSN={!Opportunity.CurrentDraftPOName__c}
&CF00N9000000AoDJR={!Opportunity.Name}
&00N9000000AnnUT={!Opportunity.Contract_Calc_Roof_Material__c}
&RecordType=012900000009E07
&retURL=%2F{!Opportunity.Id}
&saveURL=%2F{!Opportunity.CurrentDraftPOID__c}
logontokartiklogontokartik
Have you tried using global variable like '{!$Site.SiteId}' in your onclick javascript code to see if you are in a community or in enterprise instance? It would be undefined in enterprise and should return some id in community.


Pat VachonPat Vachon
Er ... uh ... I'm not using javascript.

User-added image
Brian KoBrian Ko
Not sure if you figured it out yet but {!URLFOR($Site.Prefix)} works for me. Just put that in the beginning.

So my formula was:
{!URLFOR($Site.Prefix)}
/0Q0/e?
retURL=%2F{!Opportunity.Id}
&oppid={!Opportunity.Id}
&Name={!Account.Name}+" / "+{!Opportunity.Name}
&ExpirationDate={!DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))+30}
&00N0n000000qRF7={!Opportunity.Distributor_Quote_Number__c}