I'm trying to create Sharing Reason Dynamically with Metadata API. All the tutorials online show me how to do with Custom Object and Custom Field but I would like to know the specific steps required.

  • I'm stuck on referencing the object that sharing reason pertains to. Do I need to create a Metadata.CustomObject then add the list of sharing reasons there? Will it update and removed existing fields on the object. – user51611 Nov 30 '17 at 20:02

Have you looked at this? Sharing a Record Using Apex

| improve this answer | |
  • This does not work dynamically, you would have to create the labels first – user51611 Nov 30 '17 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.