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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

setVisible method is not a function

(0) ShareShare
ReportReport
Posted on by 12
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.
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 176

#2
ManoVerse Profile Picture

ManoVerse 149 Super User 2026 Season 1

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 57 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans