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 :
Small and medium business | Business Central, N...
Suggested Answer

How to disable notes?

(0) ShareShare
ReportReport
Posted on by 555

Hi experts,

In my Business Central cloud app, I have made an extension where my new table has notes attached to it using a factbox like this on the page:

area(factboxes)

{
    systempart(Notes; Notes)
    {
        ApplicationArea = Notes;
        Visible = true;
    }
}
It works fine, but I don't want the user to change the notes that are attached to a specific table number.
I cannot make a table extension for the table "Record Link" and I cannot see which pages, I must extend. The notes must not be altered and must not be deleted. But it must be possible to press it and read the full text in view-only-mode.
I hope you can help me.
I have the same question (0)
  • Suggested answer
    NAV_with_Narang Profile Picture
    2,294 Moderator on at

    Please check if you can do it by assigning the users specific permission sets

  • Suggested answer
    Morten Steengaard Profile Picture
    555 on at

    Hi Rahul,

    Thank you for your reply.

    It might work, but before I tried it, I found out that I can solve the problem by making these event subscriptions:

       [EventSubscriber(ObjectType::Table, Database::"Record Link", 'OnBeforeModifyEvent', '', false, false)]

       local procedure OnBeforeModifyEvent(var Rec: Record "Record Link"; var xRec: Record "Record Link"; RunTrigger: Boolean)

       begin

           if Rec."Record ID".TableNo() = Database::"my table" then begin

               Message('Modify is not allowed...');

               Rec.Note := xRec.Note;  // undo the change

           end;

       end;

       [EventSubscriber(ObjectType::Table, Database::"Record Link", 'OnBeforeInsertEvent', '', false, false)]

       local procedure OnBeforeInsertEvent(var Rec: Record "Record Link"; RunTrigger: Boolean)

       begin

           if Rec."Record ID".TableNo() = Database::"my table" then begin

               Message('New note/link is not allowed...');

           end;

       end;

       [EventSubscriber(ObjectType::Table, Database::"Record Link", 'OnBeforeDeleteEvent', '', false, false)]

       local procedure OnBeforeDeleteEvent(var Rec: Record "Record Link"; RunTrigger: Boolean)

       begin

           if Rec."Record ID".TableNo() = Database::"my table" then begin

               Message('Delete is not allowed...');

               Error('Delete is not allowed...');     // This error message is never shown, but it prevents the record from being deleted

           end;

       end;

    Once again, thank you for your time.

    Best regards,

    Morten

  • Suggested answer
    Deekshitha Reddy Profile Picture
    219 on at

    Please try AccessByPermission property

    learn.microsoft.com/.../devenv-accessbypermission-property

    Hope this Helps.

    Please let me know

  • Morten Steengaard Profile Picture
    555 on at

    Hi Deekshitha Reddy,

    It might work, but I'll use the solution, I have written above.

    Best regards,

    Morten

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,175

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,476 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,435 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans