views:

265

answers:

2

Hello All, I have Dynamics CRM 4.0 installed and wrote a plugin, registered it, and setup a "step" that included a few filtering attributes. 2 questions:

1) How can I get a list of filtering attributes that are configured for my plugin? (from within the plugin itself) 2) How can I get a list of those filtering attributes that are actually on the current form being used? (also within the plugin itself)

Thanks CRM Gurus!

A: 

If you want to get every property in an image that you've sent to a plugin you can iterate through the property bag after setting it to a dynamic entity. This will include every field on the entity.

DynamicEntity postEntity = (DynamicEntity)context.PostEntityImages["entityimage"]

foreach (Property p in postEntity.Properties)
{
    // Do something with my property
}
Focus
Trying this soon, not sure this will give me what I want (metadata of the plugin filtering attributes set?)
CraigF
What is an entityimage?
CraigF
Does this give me access to the entire entity? I'm looking for just the filtering attributes that are attached to a specific step of the plugin and only the form elements (not all entity attributes).
CraigF
I'm a bit confused by your question. Are you trying to retrieve the metadata of an entity or the values that were passed into a plugin? What do you mean by "Filtering attributes"? I was assuming you meant the items filtered on a step image.
Focus
Filtering Attributes are chosen when you create a "step" while registering a plugin.
CraigF
A: 

Create a post image with just those attributes you are concerned with and access via the method shown by @Focus.

shane carvalho