Skip to content

[BUG] Set MultiValueOptionSet broken #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 of 12 tasks
mVermaat opened this issue Jul 2, 2019 · 7 comments · Fixed by #1041
Closed
4 of 12 tasks

[BUG] Set MultiValueOptionSet broken #598

mVermaat opened this issue Jul 2, 2019 · 7 comments · Fixed by #1041
Labels

Comments

@mVermaat
Copy link
Contributor

mVermaat commented Jul 2, 2019

Bug Report

EasyRepro Version

  • Microsoft Dynamics 365 Online Version 8.2 (8.2.x) (DB 8.2.x) online
  • Microsoft Dynamics 365 Online Version 9.0 (9.0.x) (DB 9.0.x) online
  • Microsoft Dynamics 365 Online Version 9.0.2 (9.0.2) (DB 9.0.2) online
  • Microsoft Dynamics 365 Online Version 9.1 (9.1.x) (DB 9.1.x) online

UCI or Classic Web

  • UCI (XrmApp)
  • Classic Web (XrmBrowser)

Online or On Premise

  • Online
  • On Premise

Browser

  • Chrome
  • Firefox
  • IE
  • Edge

Describe the bug
Setting the value of a MultiValueOptionSet doesn't work. Getting an error that the given key is not present in de dictionary on the line listed below.

string xpath = AppElements.Xpath[AppReference.MultiSelect.SelectedRecord].Replace("[NAME]", Elements.ElementId[option.Name]);

It's because my own field is not in the Elements dictionary. Why does my field have to be in there? That doesn't make sense when relating to the rest of the EasyRepro functionality. Secondary when looking into the XPATH queries, they don't seem to be correct, so even if I would add my field to the elements dictionary, it doesn't work.

@mVermaat mVermaat added the bug label Jul 2, 2019
@rcjohnson113
Copy link

Add a screenshot of the multiselect field on the form and show how you called it in code.

@mVermaat
Copy link
Contributor Author

`
[TestMethod]
public void TestMultiSelect()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

            xrmApp.Navigation.OpenApp("CRM Hub");

            xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

            xrmApp.CommandBar.ClickCommand("New");

            xrmApp.Entity.SetValue(new MultiValueOptionSet { Name = "mv_accounttype", Values = new string[] { "Supplier", "Buyer" } });

            xrmApp.Entity.Save();

        }
    }

`

This is the field on the form:

image

And the customizations to see the logicalname

image

@shijinzu
Copy link

I ran into the same issue with my project. Any idea when this issue will be resolved?

@ankitadeore19
Copy link

I am also not able to select values in the multiselect option set, any resolution for the above issue?

@shariquekhan1997
Copy link
Contributor

@shijinzu
Copy link

Thank you for posting this workaround. Could you share an example of get value on multi-select?

@shariquekhan1997
Copy link
Contributor

Thank you for posting this workaround. Could you share an example of get value on multi-select?
https://www.inogic.com/blog/2020/06/how-to-set-value-for-multi-select-attribute-in-dynamics-365-crm-using-xpath-in-easyrepro/

Selected Items are always stored in a div container with class name “msos-selecteditems-container”, the values are in the title attribute. To fetch the values from there please check the below code.

image

var container = win.HasElement(By.XPath(“//*[@Class=’msos-selecteditems-container’]”));
var selectedItems = container.GetAttribute(“title”);

Hope this helps,
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants