bad-ass-salesforce-stack icon indicating copy to clipboard operation
bad-ass-salesforce-stack copied to clipboard

API request don't work when VF page is displayed in lightning

Open ChuckJonas opened this issue 4 years ago • 0 comments

When the VF page is loaded into lightning, the request stop working because the app is using ?isdtp=p1 gets to the instance url __RESTHOST__.

Fix: update the header to remove extra junk:

const __RESTHOST__ = '{!URLFOR("/", null)}'.replace("?isdtp=p1", "");

Might want to come up with a more robust solution as there might be other URL param/values that get appended

ChuckJonas avatar Jul 08 '20 20:07 ChuckJonas