How to Run Localhost in Salesforce
There are two ways to run localhost in Salesforce:
By Changing SRC in iFrame Manually
Start localhost (pricefx-sfdc-canvas & pricefx-modules).
Open iFrame in Salesforce which is connected to the localhost.
In Developer Tools find iFrame and add an attribute:
src="http://localhost:3000/#/"
Â
Â
By Appending SRC Using JavaScript Code in Console
Start localhost pricefx-modules.
Open iFrame in Salesforce which is connected to the localhost.
Select Outer Pricefx Canvas.
Â
Execute this code in the console:
const allIframes = document.querySelectorAll('iframe'); if (allIframes.length > 0) { const firstIframe = allIframes[0]; firstIframe.src = 'http://localhost:3000/#/'; console.log('Updated src:', firstIframe.src); } else { console.error('No iframes found on the page.'); }
Found an issue in documentation? Write to us.
Â
Pricefx version 13.1