Hi All,
I am very new to to writing plugin codes . i nees to some help regarding accessing subgrid record.
following is the scenario.
Entity A: having lookp of Entity B as "Current Status"
Entity B: have subgrid of mails
i need to write plugin on create of entity A to extract the related records of "mails" of the record present in lookup(Current status) on Entity A
can anybody help
First of all try to get GUID of lookup record in ms crm plugin using below syntax:
Guid EntityBId = EntityB.Attributes.Contains("lookuplogicalname") && EntityB.Attributes["lookuplogicalname"] != null ? EntityB.GetAttributeValue<EntityReference>("lookuplogicalname").Id : Guid.Empty;
Then pass this GUID to either LINQ, fetchexpression or query expression to retrieve all related email's with entity B.
Please refer below url for reference:
csharp.hotexamples.com/.../php-fetchexpression-class-examples.html
Here's are articles on images and queries
Images:
Querying:
!. Get the ID of the lookup on Entity A. You can do this using the post image or query it.
2. FetchExpression or QueryExpression (depending on the coding standard you're using on your project) to retrieve all mails where the lookup on those records in the ID of the lookup you retrieved from Entity A
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156