question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] GetValue not working

See original GitHub issue

Bug Report

xrmApp.Entity.GetValue command not working.

EasyRepro Version

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

UCI or Classic Web

  • UCI (XrmApp)

Online or On Premise

  • Online

Browser

  • Chrome

Describe the bug
Hi guys, seems like the GetValue command is not working. I have checked EasyRepro repo and it seems to be trying to find “input” or “textarea” tagname when using the GetValue command.

if (fieldContainer.FindElements(By.TagName(“input”)).Count > 0) { var input = fieldContainer.FindElement(By.TagName(“input”)); if (input != null) { IWebElement fieldValue = input.FindElement(By.XPath(AppElements.Xpath[AppReference.Entity.TextFieldValue].Replace(“[NAME]”, field))); text = fieldValue.GetAttribute(“value”).ToString();

                    // Needed if getting a date field which also displays time as there isn't a date specifc GetValue method
                    var timefields = driver.FindElements(By.XPath(AppElements.Xpath[AppReference.Entity.FieldControlDateTimeTimeInputUCI].Replace("[FIELD]", field)));
                    if (timefields.Any())
                    {
                        text = $" {timefields.First().GetAttribute("value")}";
                    }
                }
            }
            else if (fieldContainer.FindElements(By.TagName("textarea")).Count > 0)
            {
                text = fieldContainer.FindElement(By.TagName("textarea")).GetAttribute("value");
            }
            else
            {
                throw new Exception($"Field with name {field} does not exist.");
            }

Some of the LookupItems are now <div> or

    so it is throwing "Field element {name} does not exist. This was working fine on Friday. We picked the issue yesterday, and we know that there was a Microsoft update during the weekend.

    Code to reproduce

    xrmApp.Entity.GetValue(new LookupItem { Name = “name”});

    Expected behavior
    LookupItem value should be found

    Screenshots

    lookup

    lookup2

    If you can look into this ASAP should be great. Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
AngelRodriguez8008commented, Feb 19, 2020

Sorry. I’m not able to do it. Probably the MS guys did it.

0reactions
imartinflorescommented, Feb 19, 2020

No worries, thanks for helping!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] GetValue is not working · Issue #1185
Bug Report Issues should only be created for items related to covered functionality. Not covered functionality, feature requests, ...
Read more >
IConfiguration does not contain a definition for GetValue
After moving a class through projects, one of the IConfiguration methods, GetValue<T> , stopped working. The usage is like this:
Read more >
GetValue does not return results for Dynamic Item Related ...
The GetValue method is invoked on the master item. OR The dynamic item is localized and the culture of the current context is...
Read more >
e.GetValue not working in HtmlRowPrepared event
In HtmlRowPrepared event, sometimes e.GetValue is not finding some columns, especially when trying to delete a parent node with some ...
Read more >
GetValue causes a Null reference exception when called from ...
error is thrown whenever GetValue is used on a dynamic content item, trying to get a numeric field's value. The issue happens when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found