0

I am creating a Managed Package with some custom objects and LWC components. I have one batch job in a managed package that will run while installing the package. After installing a Managed package in Subscriber org I can see the data in SOQL but it's not coming in UI I mean in LWC. But when I run the same batch through the Dev console it's working fine.

Any suggestions please.

1
  • 1
    The batch will run in the context of the package's "ghost user" and unless you explicitly ensure the batch sets ownership of these records, they will be owned by this ghost user. If you then have specific sharing rules, it is likely no one else (other than admins) would have any sharing access to this data.
    – Phil W
    Commented May 3 at 10:47

1 Answer 1

0

Because it is executed from the package's post-install script, the batch will run in the context of the package's "ghost user".

If you have records being created by the batch, unless you explicitly ensure the batch sets ownership of these records, they will be owned by this ghost user. If you then have specific sharing rules, it is likely no one else (other than admins) would have any access to this data since that ghost user is unlikely to be included in any of the role hierarchies or groups used.

To solve this, ensure that the batch explicitly sets the owner to some appropriate user or group during data creation.

You must log in to answer this question.

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