I've been trying to pass recordId from fsl app to salesforce app for a while now, I've tried various methods but still no luck can anyone share a thorough way to perform this task?
PASS THE RECORD ID FROM FSL TO SF APPLICATION:-
step 1: create aura application:
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="YOUR LWC NAME"/>
</aura:application>
step 2: create vf page:-
<apex:page docType="html-5.0">
<apex:includeLightning />
<div id="lightning"/>
<script>
//Get the parameter named msg
var msg = "{!$CurrentPage.parameters.msg}";
// If msg is null, find it parsing the page URL
if (msg== null || msg=="") {
var urlEnc=window.location.href;
var splitted1 = urlEnc.split('=');
var splitted=splitted1[2].split('&');
msg=splitted[0];
}
//Create the Lighting Component inside the VisualForcePage
$Lightning.use("c:YOUR AURA APP NAME", function() {
$Lightning.createComponent("c:YOUR LWC NAME",{"recordId" : msg},"lightning",
function(cmp) {
});
});
</script>
</apex:page>
step 3: create tab for this vf page
step 4: enable checkbox in vf page settings
step 5: inside field service mobile settings create an app
extension choose type as lightning app and provide launch value as "tabname?msg={!Id}"
step 6:now just use @api recordId to fetch the record id of current page