Timeline for Pass Record Id from Salesforce Site URL to LWC
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 17, 2023 at 7:04 | comment | added | Caspar Harmer |
Try defining your class as public without sharing class
|
|
Jul 17, 2023 at 3:23 | comment | added | Mike | Thank you, I was able to render the site page without errors, however the "getRecord" wire adapter still was not returning a record. To troubleshoot, I added a lightning-button to the HTML file and created/imported an Apex Class that retrieves the record when the button is clicked. When the button is clicked, Chrome returns "error: [object Object]" in the console. I setup a debug log on the site user and the Apex method is returning "System.QueryException: List has no rows for assignment to SObject." Even after I hardcode the recordId in the SOQL, the system error still appears. I'm stumped. | |
Jul 17, 2023 at 0:53 | comment | added | Caspar Harmer |
Have you defined class member - obaForm = {"data":{}}; . Also, try disabling the getFormName method as it could be causing the error.
|
|
Jul 17, 2023 at 0:14 | comment | added | Mike | Thank you for the debugging tip. This is the error message that is getting returned: "This page has an error. You might just need to refresh it. Error in $A.getCallback() [Error during LWC component connect phase: [Cannot read properties of undefined (reading 'data')]] Failing descriptor: {ltng:outApp}" | |
Jul 16, 2023 at 21:45 | history | answered | Caspar Harmer | CC BY-SA 4.0 |