0

I have a custom Javascript button on the OpportunityLineItem object that brings users to a Visualforce page when clicked. All works fine, however, we utilize Communities for our reseller partners and the URL in the button does not work for their instance since they have an additional "/reseller" component after the standard URL. Does anyone know how I can create and IF/THEN statement to look for that piece in the url? My Javascript is below:

window.open('/apex/opportunityProductEntry?id={!Opportunity.Id}')

I would need the code below to fire if the URL contained "/reseller"

window.open('/reseller/apex/opportunityProductEntry?id={!Opportunity.Id}')
1

1 Answer 1

0

Please refer this url https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_site.htm

$site.prefix should fulfill your requirement.

Try like

window.open('{!$site.prefix} /apex/opportunityProductEntry?id={!Opportunity.Id}')

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.