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}')