• Rochelle Lobo
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am getting this error on the following line

CaseShare sharingForCase = new CaseShare();
sharingForCase.UserOrGroupID = sm.User__c;
sharingForCase.CaseId = singleCase.Id;
sharingForCase.CaseAccessLevel = 'Read';

where sm is a record of a custom object, and User__c is a lookup field to User.
Since I know you can actually create new CaseShare records and define for which user, does anybody have an ides/experience why this would cause an error?
Thank you in advance!