You need to sign in to do that
Don't have an account?
Sharing Records are not queried in Test Class.
I want to create Opportunity Share records for two custom fields "Manager" and "Senior Manager" lookup to User on Opportunity object.
My Batch job is working as expected and creating those record perfectly.
But, the issue is in Test Class:
My Batch job is working as expected and creating those record perfectly.
But, the issue is in Test Class:
- I have created one createOpportunity() method, and create two Opportunities.
- Both the opportunities have Manager / Senior Manager field populated with User.
- Now, when I run this method, It will cover my Batch job and create sharing records ( that I can debug in batch job).
- If I am trying to query those sharing record in Test Class using below query, it is giving 0 records.
- SELECT Id, manager__c, senior_manager__c, rowcause from Opportunity.
Thanks for your response, but unfortunetly I can't.
If you have any particular blog / article which is calling covering Batch Class code for Sharing records. Please share.
Thanks,
Gaurav