ChuckJonas / bad-ass-salesforce-stack

B.A.S.S. Starter: react / redux / typescript / antd / ts-force / sfdx / webpack / salesforce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ChuckJonas opened this issue · 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