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 :
Business Central forum

Visible Property issue in sales order subpage based on conditon.

(0) ShareShare
ReportReport
Posted on by 86

Based on type i.e. Item, GL Account we have written a code to hide certain field. 

We also have written CurrPage.update();

This is working fine, but issues comes up when we try to move to next or previous record, a message comes up and ask, Do you want rename the record (Y/N) ? If we click No nothing happens means the dialog window remain there no matter how many times you click No. But if you click yes then the windows gone.

Second if we try to use the copy functionality and choose a document and click OK, the document is copied, but if we click on next line, an error pops says there is an error and the page will close with document no.

This is on SaaS version, have not tried on On-Prem.

Categories:
I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    On which trigger did you add the CurrPage.Update statement? I don't think you can control the visibility of a control dynamically, you can control the edit or enable.

  • ManishS Profile Picture
    86 on at

    OnAfterGetRecord and No. - OnValidate()

    But if i don't use the next & previous then there is not issue and it works fine.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Can you try adding only on the OnAfterGetRecord page, but not on the ONValidate.

  • Suggested answer
    Peter Zentner Profile Picture
    390 on at

    The visibility of a control/field cannot be changed after the page is open. You would have to use Editable or Enabled, which you can change dynamically. You can hide fields in the OnOpenPage, but this won't help you, since you do want to make the change based on certain record values. So, you will just have to mark those fields enabled = false, for instance.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans