0

When I run sfdx:force:version:create command to create 2GP managed package version I got the following error in my Lightning Record Page:

“Component [console:relatedRecord] attribute [lookupFieldName]: Cannot accept value [%s] for lookup field value for related record component MyCustomObj__c.Case__c.“

Does anyone have any idea how to fix it or has encountered this before ?

4
  • Similar this. Commented Nov 22, 2023 at 9:26
  • Hello, but if I remove the compoment from the package how will I get it back into the package, I am creating this package to create listing in AppExchange Commented Nov 22, 2023 at 10:15
  • I fully agree that the workaround recommended by Salesforce (manual creation on subscriber orgs) is very unsatisfying. I'd at the same time try again after launching the new package version and - contact Salesforce support. Commented Nov 22, 2023 at 11:12
  • Yeah, so having related record component is not allowed when it comes to packaging? Commented Nov 22, 2023 at 12:28

1 Answer 1

0

You can remove the Related List component from the Page before creating package, and retrieve the Updated Metadata on your project because the reference will be used from the Metadata CFG CLI will use from the Package.xml file.

Later, if required you can add the Related Action/ Related List on the Page Layout on the Target Environment.

3
  • Hello, but if I remove the compoment from the package how will I get it back into the package, I am creating this package to create listing in AppExchange. Commented Nov 22, 2023 at 9:33
  • Hello Hasan, Can you tell me If you have added the MyCustomObject__c and Case__c Object and Field Metadata into the Package or not? Because, there can be some dependencies existed which may prevent this Packaging process. Commented Nov 23, 2023 at 5:54
  • Hello Sourav, yes I can confirm that I added all the related fields to the package Commented Nov 23, 2023 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .