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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Prevent editing Purchase Order Page Card in AL code

(0) ShareShare
ReportReport
Posted on by 297

2 Users can create new Purchase Order.

How to prevent User A to edit Purchase Order created by User B using AL Code

User A can only view User B's PO.

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,979 Super User 2025 Season 2 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    Did you try any code? what error are you facing?

  • Hoang Ng Profile Picture
    297 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    Hi Yadav,

    I don't know what trigger or method should be used to lock editing the page so I have not written the code.

  • Verified answer
    Mohana Yadav Profile Picture
    60,979 Super User 2025 Season 2 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    Please use OnBeforeModify trigger

  • Hoang Ng Profile Picture
    297 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    Thanks Yadav,

    I will try your suggestion.

    Do you know which Action of Edit button ?

    I try to set Enabled= false for it.

    pastedimage1677578149915v1.png

  • Verified answer
    Mohana Yadav Profile Picture
    60,979 Super User 2025 Season 2 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    You can throw error if other user is trying to modify the document as well using ERROR('You are not allowed to modify this document.');

  • Hoang Ng Profile Picture
    297 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    I found a code that lock Edit and Delete:

    CurrPage.Editable(false);

  • Suggested answer
    Mohana Yadav Profile Picture
    60,979 Super User 2025 Season 2 on at
    RE: Prevent editing Purchase Order Page Card in AL code

    Great. Keep learning and Thank you.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,351

#2
Sumit Singh Profile Picture

Sumit Singh 2,072

#3
YUN ZHU Profile Picture

YUN ZHU 1,807 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans