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
Nhormand  FF FernandoNhormand FF Fernando 

Custom button not working in Communities

Hi.
I have this custom button that works fine in regular UI but not in communities.  How do I make this work in communities.

{!URLFOR( $Action.FAE_Account_Allocation__c.New , null, [saveURL=FAE_Tracker_Entry__c.Id, retURL=FAE_Tracker_Entry__c.Id, CF00Nc0000001INF4_lkid=FAE_Tracker_Entry__c.Id , CF00Nc0000001INF4=FAE_Tracker_Entry__c.Name])}

Appreciate the help.
 
Andy BoettcherAndy Boettcher
Communities have a subdirectory in the URL as the name of that community:

Regular SF:  https://naX.salesforce.com/000000000000000
Communities:  https://naX.salesforce.com/communityname/000000000000000

When you bring links (or Apex pagereferences) into the world, the normal relative ('\whatever') URL approach will not work in Communities.  You need to use the {!Site.Prefix} VF variable to get the /communityname to pop into the VF URL.  The same {!Site.Prefix} variable works in "normal" Salesforce as it comes back null and doesn't add anything to the URL.
Ashsih jaiswalAshsih jaiswal
HI Andy Boettcher,

Can you please give some example URL for community.
I have used  {!Site.Prefix} into my URL but still is not working. So please see the below URL is correct or not.
if not correct then Please suggest.

{!Site.Prefix}/communityname/apex/Address?accId={!Account.Id }&retURL=%2F{!Account.Id}
Ashsih jaiswalAshsih jaiswal
@Andy Boettcher

Can you please give some example URL for community.
I have used  {!Site.Prefix} into my URL but still is not working. So please see the below URL is correct or not.
if not correct then Please suggest.

{!Site.Prefix}/communityname/apex/Address?accId={!Account.Id }&retURL=%2F{!Account.Id}