简体   繁体   中英

CRM D365 update polymorphic/multitable lookup via Plugin

I'm trying to update a polymorphic lookup column on a table via plugin code and it doesn't seem happening. Wondering what additional I'm missing.

var entity1Id = "af435c64-a264-4f2a-9cee-22069ce36b3c";
var destinationEntity = new Entity("bookableresourcebooking", new Guid(myBookingGuid));
destinationEntity["my_ploymorphiclookupid"] = new EntityReference("my_entity1", new Guid(entity1Id));
organizationService.Update(destinationEntity);

my_ploymorphiclookupid is a polymorphic lookup (N:1) to my_entity1

Code looks fine. If you didn't see any runtime errors in plug-in trace log, then few diagnosis steps needed.

  1. Check audit history of that record
  2. Chances of any other plugin steps replacing the value back or rolling back
  3. Try to profile/debug the plugin for clues

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM