Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

"Target" parameter in InputParameters of plugin Context

Posted on by 6
I have been trying to access the "Target" and "RelatedEntities" parameters from InputParameters of Plugin Context.
Here is the snippet of code I've been using:
 
var targetEntity = ((EntityReference)context.NativeContext.InputParameters["Target"]);
var relatedEntity = ((EntityReferenceCollection)context.NativeContext.InputParameters["RelatedEntities"])[0];
values of entities in classical view:
targetEntity would be referring to "ABC" entity
relatedEntity would be referring to "XYZ" entity
 
values of entities in Unified View App:
targetEntity would be referring to "XYZ" entity
relatedEntity would be referring to "ABC" entity
 
why is this difference so and is there any way out of this?
any help would be greatly appreciated.
  • NT-29050956-0 Profile Picture
    NT-29050956-0 6 on at
    "Target" parameter in InputParameters of plugin Context
    NativeContext holds the plugin Context 
    NativeContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    "Target" parameter in InputParameters of plugin Context
    Hi,
     
    Where is the NativeContext property in the code snippet you provided. 
    This property is not found in the IPluginExecutionContext interface.
     
    Do values ​​of entities in classical view refer to creating entities in the advanced settings to execute the plugin?
     
    Best Regards,
    Dengliang Li
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans