Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Multiselect OptionSet is always null in plugin post-image

Posted on by 215

Hello everyone,

I have registered a post-image (with all attributes) for my plugin in CRM Online.

However, the multiselect optionset field is always null when I get it from the post-image.

Entity postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null;
var values = postImageEntity.GetAttributeValue("new_multioption");

If I retrieve the record using the service.Retrieve, then everything works fine. But this is not good at performance.

Does anyone know why this happens?

Thanks,

Kim Anh

  • Dung Ho Profile Picture
    Dung Ho 40 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hello Kumar,

    Have you tried with the Post-Update plugin? I got the same issue before with the image of Post-Update plugin (not Post-Create in your case).

    Could you please check that?

    Thanks.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hi,

    Today I verified in my instance and i was able to get multi optionset field value from post image.

    I have registered plugin steps on Account entity, message is create and execution pipeline is Post Operation. Also I have registered post image and selected multi optionset fields.

    See below screenshot and highlighted section where we are able to get multi optionset value.

    8585.CQ2.PNG

    Please Mark My Answer Verified If I Were Helpful

  • Anh Luu Profile Picture
    Anh Luu 215 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hi Bipin Kumar,

    I updated my post (my code is correct, but I had some mistakes when copying the code here).

    The point here is that when I debug the code, I see that the multiselect attribute in the post-image is always null.

    Have you experienced this issue before? And you could really get the value of multiselect field in the post-image?

    Regards,

    Kim Anh

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hi,

    The code you mentioned is not from image instead you are getting it from service call Retrieve.

    Can you pls confirm if you have used different code to get value from image.

    Please Mark My Answer Verified If I Were Helpful

  • Anh Luu Profile Picture
    Anh Luu 215 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hi Menna El Sayed Galal,

    Yes, the MultiSelect attribute is shown in the registration tool, but the issue still exists.

    Here is the code I use to get the value of the MultiSelect field from the image:

    Entity postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null;
    var values = postImageEntity.GetAttributeValue("new_multioption");

    Thanks for your help,

    Kim Anh

  • RE: Multiselect OptionSet is always null in plugin post-image

    Hello Kim,

    Please make sure that the multiSelect Optionset field is appearing in the parameters list inside the plugin registration tool and is being marked as below

    if not please use the latest update of the tool.

    pastedimage1597137073464v1.png

    if the problem still exist please share with me the line of code of retrieving the image attribute values.

    Thanks,

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Hi,

    Multiselect optionsetset field is not available in filtering attributes and pre/post image.

    See below article for your reference and workaround.

    blog.magnetismsolutions.com/.../triggering-plugins-on-update-of-multi-select-option-set-in-dynamics-365

    Above article is older, so I would suggest you to use latest version of plugin registration tool and instead of selecting all attributes in post image. Check and see if multi select option is appearing in list of attributes.

    Download latest sdk tools - http://xrm.tools/

    If found helpful, Please mark my answer verified.

  • Anh Luu Profile Picture
    Anh Luu 215 on at
    RE: Multiselect OptionSet is always null in plugin post-image

    Any ideas?

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans