Last active
October 5, 2022 15:45
-
-
Save robertStrunk/f94e6a9d6d3fd7109cd822fe0544fa46 to your computer and use it in GitHub Desktop.
Lightning:Out VFP with EasyXDM CPQ Integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
This is a template page that can be used as a starting point when needing to create an EasyXDM enabled | |
visualforce page that is called by a custom action in order to open custom UIs in the QLE | |
--> | |
<apex:page showheader="false" sidebar="false" id="thePage" lightningstylesheets="true" doctype="html-5.0"> | |
<head> | |
<apex:slds /> | |
<apex:includeLightning /> | |
<title>YOUR TITLE HERE</title> | |
<script type="text/javascript" src="{!$Resource.SBQQ__easyXDM}"></script> | |
<script type="text/javascript" id="script"> | |
var rpc = new easyXDM.Rpc({},{ | |
remote: { | |
postMessage: {} | |
}, | |
local: { | |
postMessage: function(message) { | |
$Lightning.use( | |
"c:YOUR_OUT_APP_HERE",//TODO: ADD YOUR LIGHTNING OUT APP | |
function() { | |
debugger; | |
// make sure your component has two public attributes for CD and XDM | |
// your component should be able to get the quoteId from the CD object | |
// so that it can query for whatever data it needs. | |
$Lightning.createComponent( | |
"c:YOUR_LIGHTNING_CMP_HERE", // TODO: add aura/lwc cmp name here | |
{ | |
"xdm": easyXDM, | |
"cd": JSON.parse(message) | |
}, | |
"injectionPoint", | |
function(cmp) {debugger;}// TODO: implement callback as needed | |
); | |
} | |
); | |
} | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="injectionPoint"></div> | |
</body> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment