web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

setDisabled doesn't work in Wave2 2020

(2) ShareShare
ReportReport
Posted on by 140 Most Valuable Professional

Hi, 

Does anybody has the same problem in Wave2 2020, and knows when it will get fixed?

Using the Xrm SDK , when setDisabled(true) is called from another tab, it doesn't work.

After switching back to the tab containing the control, setDisabled with the same value (in my case "true") won't have any effect until I call it one with "false".

Another special effect: after I switch back to the tab containing my control, I can edit the control only ONCE. After I leave the control,  it gets finally disabled:

setDisabled.gif

Kind regards,

Diana

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at
    RE: setDisabled doesn't work in Wave2 2020

    Hi Diana Birkelbach,

    The Xrm.Page Client API is deprecated so use its replacement Client API instead.

    formContext.getControl(arg).setDisabled(bool);

  • Diana Birkelbach Profile Picture
    140 Most Valuable Professional on at
    RE: setDisabled doesn't work in Wave2 2020

    Hi Adrian Begovich,

    That doesn't work nether. I've posted the Xrm.Page way to access it, because it's simpler to test in the console, without having to write a script for it.

    Besides that, Xrm.Page is deprecated but not removed yet, so it should still work.

    But as I said, the "formContext" way to access it, doesn't work too.

    Kind regards,

    Diana

  • Peter Hale - QLD Profile Picture
    480 on at
    RE: setDisabled doesn't work in Wave2 2020

    We are having issues as well - have find a work around or a ticket - or just let the disabled not work until it is fixed

  • Peter Hale - QLD Profile Picture
    480 on at
    RE: setDisabled doesn't work in Wave2 2020

    our issue is actually setVisible   -   TypeError: Cannot read property 'setVisible' of null   -  and I'm using FormContext

    might need to do a 'null' test

  • PabloCRP Profile Picture
    1,088 on at
    RE: setDisabled doesn't work in Wave2 2020

    I didn't notice about it but you can replicate change de setDisabled method from other tab then return  and changing that value then it get disabled, Any Update? in UCI interfacce

  • Dima M. Profile Picture
    49 on at
    RE: setDisabled doesn't work in Wave2 2020

    Hi Diana,

    just wanted to inform you that I am facing the exact same issue when I try to disable all controls when a condition is met after saving the record. It seems to work on the current tab, but not on other tabs. I also tried to call setDisabled on TabStateChange - with original context from OnLoad-Event and context from TabStateChange-Event - nothing seems to work. It only works when I reload the whole page or reopen the record.

    *EDIT*: Same effect comes up with business rules.

    Kind regards,

    Dima.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 169

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 65

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 63 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans