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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Unable to set 'Visible' property to No in form Extension D365

(0) ShareShare
ReportReport
Posted on by 1,128

I created extension of HcmPosition form and now I want to hide some columns on the form.

I was able to make "Visible" property of most fields to No but I have one field and the Visible property is grayed out. Any idea how I can hide this field?  See the attached image where the Visible Property is grayed out.

pastedimage1571257130176v2.png

Thank you

I have the same question (0)
  • Suggested answer
    Andrew Xu Profile Picture
    3,877 on at

    This is referenceGroupControl, you need to set up property at its parent which is HcmPositionHierarchyLine_ParentPositionCopy1.

  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Ann,

    You can control the property by coding.

    Table_ds.object(fieldNum(Table, Field1)).visible(true);  This method can change the "visible" through Datasource.

    Please create an extension class and put the following codes in it.

    pastedimage1571279534930v1.png

    pastedimage1571279772262v2.png

    You can find the DS and field with the property of the control.

  • Ann2015 Profile Picture
    1,128 on at

    Thank you so much Will. It worked perfect.

    Ann

  • Evaldas Profile Picture
    1,800 on at

    Why do you create and extension class and add event handler in it?

    Extension classes should not be used for event handlers, as there is a tiny problem with them.

    daxmusings.codecrib.com/.../accidental-code-extensions.html

    It also gives a best practice warning.

    If you need an event handler class remove final keyword and ExtensionOf attribute, and name it something like HcmPositionEventHandlers or something else.

    Actually, you can access any control in Extension class just by writing a name of the control and calling the method.

    It's not obvious but it works.

    elandax.blogspot.com/.../can-you-ignore-auto-declaration.html

    This is good if you want to hide just this particular control:

    HcmPositionHierarchyLine_ParentPositionCopy1_PositionId.visible(false);

    If you want to hide all controls of this field when the code DataSource.object(fieldid).visible(false) is valid.

    Just don't use hardcoded strings instead, use formDataSourceStr intrinsic function.

    Or use CoC, it's much easier and more readable than event handlers.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans