I have created an LWC that takes the recordId from the URL.
https://myurl.lightning.force.com/lightning/n/invoice?c__recordId=a0B1q00000Jy2ZeEAJ
Now I have added the LWC in the aura component and added the aura component in a Visualforce page. Then I made the Visualforce page public by creating a new Force.com Site.
My new URL is https://myurl.force.com/invoice
I have tried
https://myurl.force.com/invoice?Id=a0B1q00000Jy2ZeEAJ
https://myurl.force.com/invoice?recordId=a0B1q00000Jy2ZeEAJ
https://myurl.force.com/invoice?c__recordId=a0B1q00000Jy2ZeEAJ
But I am not getting the parameter from the URL to my LWC. How to solve this problem?
PublicInvoice.app
<aura:application extends="ltng:outApp" implements="ltng:allowGuestAccess" access="Global">
<aura:dependency resource="c:molliePayment"/>
</aura:application>
PublicPayment.page
<apex:page standardController="Verkoopfactuur__c" lightningStylesheets="true">
<apex:includeLightning />
<div id="LightningAppDivId"></div>
<script>
$Lightning.use("c:PublicInvoice", function() {
$Lightning.createComponent("c:molliePayment", {
recordId : "{!$CurrentPage.parameters.Id}"
},
"LightningAppDivId",
function(component) {
});
});
</script>
</apex:page>
I've managed to solve the issue.
Needed to replace "Id" with "id".