1

I am working on a scenario wherein when a user lookup field is filled an Object_Share record is created so that the lookup user can access the record.

So in the trigger I have a function where a Object_share record is created for each record.

For trigger.update it is understandable that sharedRecord.parentId = lookupuser.id. I am wondering how to fill parentId in case of trigger.insert ,as id would not have been created .

What is the workaround for creating shared record in insert?

1
  • ParentId is Id of the record, it is not lookupuser.id. and in this case write your trigger on after insert,after update
    – C0DEPirate
    Commented Jul 6, 2016 at 11:26

1 Answer 1

1

Please use After Insert event in the trigger as in After Insert records will have the ID assigned to them.

You must log in to answer this question.

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