function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kore SAMBARAJUKore SAMBARAJU 

Custom fields are not getting query from Custom Object after installing a 2GP managed package

I have created a 2GP-managed package that includes an Apex class with SOQL queries. But from one SOQL query, which is on a custom object, I am unable to get the data for custom fields from that custom object. I am able to get standard fields from that same custom object.
I am just getting blank fields in the Lightning data table.
Best Answer chosen by Kore SAMBARAJU
Kore SAMBARAJUKore SAMBARAJU
This issue got resolved. The field API Names in LWC JS  must be Prefix with Name Space. Here is the exact information :  https://salesforce.stackexchange.com/questions/412494/custom-fields-are-not-getting-query-from-custom-object-after-installing-a-2gp-ma  (https://salesforce.stackexchange.com/questions/412494/custom-fields-are-not-getting-query-from-custom-object-after-installing-a-2gp-ma)

All Answers

HarshHarsh (Salesforce Developers) 
Hi Sambharaju,

Please follow the following link of your question on Stack Exchange,

https://salesforce.stackexchange.com/questions/412494/custom-fields-are-not-getting-query-from-custom-object-after-installing-a-2gp-ma
 
You may have not granted the appropriate field-level security for your custom fields in your package. You need to ensure that the profile or permission set that you are using to access the custom object has read access to the custom fields.

Please mark it as Best Answer if the above information was helpful.

Thanks.
 
Kore SAMBARAJUKore SAMBARAJU
Hii  @Harsh  I have given read and edit access for my custom fields on custom object. even though iam getting this issue .
Kore SAMBARAJUKore SAMBARAJU
This issue got resolved. The field API Names in LWC JS  must be Prefix with Name Space. Here is the exact information :  https://salesforce.stackexchange.com/questions/412494/custom-fields-are-not-getting-query-from-custom-object-after-installing-a-2gp-ma  (https://salesforce.stackexchange.com/questions/412494/custom-fields-are-not-getting-query-from-custom-object-after-installing-a-2gp-ma)
This was selected as the best answer