Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

setVisible method is not a function

Posted on by 6
The following code when executed in on-prem version of MD Dynamics CRM throws an error
 
let x = this._formContext.ui.formSelector.getCurrentItem().getId()this._formContext.ui.formSelector.items.forEach(    function(f){  if(f.getId()!=x)              f.setVisible(false);  }  );
give the following error:

Uncaught TypeError: f.setVisible is not a function
    at eval (eval at Event_OnLoad (EventForm.js?ver=730334979:25207:35), <anonymous>:5:17)
    at Xrm.XrmFormSelectorItems.forEach (global.ashx?ver=730334979:2939:13)
    at eval (eval at Event_OnLoad (EventForm.js?ver=730334979:25207:35), <anonymous>:2:41)
    at EventForm.Event_OnLoad (EventForm.js?ver=730334979:25207:35)
    at eval (eval at RunHandlerInternal (ClientApiWrapper.aspx?ver=730334979:154:1), <anonymous>:1:34)
    at RunHandlerInternal (ClientApiWrapper.aspx?ver=730334979:160:1)
    at RunHandlers (ClientApiWrapper.aspx?ver=730334979:118:1)
    at OnScriptTagLoaded (ClientApiWrapper.aspx?ver=730334979:275:1)
    at ClientApiWrapper.aspx?ver=730334979:244:1

But the same piece of code works fine on Unified View. Need some insights on this.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans