Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to pass a Multi-select option set value as a parameter to Xrm.Utility.openEntityForm?

Posted on by 925

I'm currently trying to copy values over to a new form with Javascript and having issues with Multi-select option set.

This is the error I get:

Error converting value 629940000 to type 'System.Collections.Generic.List`1[System.Int32]'. Path '', line 1, position 9. ---> System.ArgumentException: Could not cast or convert from System.Int64 to System.Collections.Generic.List`1[System.Int32].

What I've tried:

var parameters = {};

parameters["new_class"] = [629940000,629940001];
Xrm.Utility.openEntityForm("quote", null, parameters);

//Also tried:
var parameters = {};
parameters["new_class"] = Xrm.Page.getAttribute("new_class").getValue();
Xrm.Utility.openEntityForm("quote", null, parameters);

Both tests are giving me the same result. Is it event possible to achieve this?

Thanks in advance for your replies,

Best Regards

*This post is locked for comments

  • ajyendra Profile Picture
    ajyendra 1,730 on at
    RE: How to pass a Multi-select option set value as a parameter to Xrm.Utility.openEntityForm?

    Hi @Loic Orue,

    Both cases quote form is open for me. Is your form is not open is that the issue or I misunderstood something?

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to pass a Multi-select option set value as a parameter to Xrm.Utility.openEntityForm?

    Below is the official documentation-

    docs.microsoft.com/.../set-field-values-using-parameters-passed-form

    Hope this helps.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to pass a Multi-select option set value as a parameter to Xrm.Utility.openEntityForm?

    Hi,

    Take a look at this-

    dynamicsofdynamicscrm.com/.../

    Hope this helps.

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