0

I am trying to open a VF page in community site and in Salesforce using same custom button added on Opportunity Layout. I tried multiple ways to achieve this, but nothing working as expected. enter image description here

Community is setup with sub-domain 'test': https://test-sandbox-developer-edition.cs114.force.com/test

  1. {!$Site.Prefix}/apex/vfpage?id={!Opportunity.Id}

This is working fine in salesforce, but in Community it is throwing error

You have sent us an Illegal URL or an improperly formatted request. %2Fpartners/apex/vfpage?id=xxxxxxxxxxxxxx

  1. {!URLFOR($Site.Prefix+'/apex/vfpage?id='+Opportunity.Id, null, null, false)}

This is working fine in both salesforce and community, but loading vf page in an iframe which is causing some redirection issue while performing actions on the page (like back action)

  1. {!SUBSTITUTE($Site.Prefix, '/','')}/apex/vfpage?id={!Opportunity.Id}

This is working again fine in salesforce, but in Community it is throwing error because / is missing before the prefix

prefix/apex/vfpage?id=xxxxxxxxxxxxxx

3
  • have you tried just ./apex/vfpage?id={!Opportunity.id}? (I think this won't work from VF to VF, but if you are outside a VF and want to get inside... it might?) Mar 6, 2021 at 10:50
  • @SergioAlcocer It's not working, getting 'You have sent us an Illegal URL or an improperly formatted request.' error
    – user1228
    Mar 6, 2021 at 10:53
  • @SergioAlcocer I am trying to open a VF page using custom button.
    – user1228
    Mar 6, 2021 at 10:55

0

You must log in to answer this question.

Browse other questions tagged .