", "answerCount": 2, "upvoteCount": 1, "datePublished": "2021-12-01T15:35:27.000Z", "author": { "@type": "Person", "name": "Ahmed Ridowan", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000ELCULQA5", "affiliation": { "@type": "Organization", "name": "CapitalGurus" } }, "acceptedAnswer": { "@type": "Answer", "text": "I've managed to solve the issue. Needed to replace \"Id\" with \"id\". https://myurl.force.com/invoice?id=a0B1q00000Jy2ZeEAJ", "upvoteCount": 2, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000DxnrISAR", "datePublished": "2022-07-19T10:16:09.000Z", "author": { "@type": "Person", "name": "Ahmed Ridowan", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000ELCULQA5", "affiliation": { "@type": "Organization", "name": "CapitalGurus" } } }, "suggestedAnswer": [] } } Skip to main content
Ahmed Ridowan (CapitalGurus) a posé une question dans #Sales Cloud

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>

 

#Sales Cloud #Salesforce Developer  #LWC Component

2 réponses
0/9000