Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Keep userse from seeing Purchase Invoice, but be able to approve

(0) ShareShare
ReportReport
Posted on by 10

I am in a situaltion where we want people to be able to approve Purchase Invoice, on page 662 Approval Request Entries.

But it has a OnAfterGetCurrRecord trigger where it gets the record in the Table ID field with a RecRef, so you would need to have the Read permission for that record, Purchase Header in this instance.
But i dont want them to have read permission to Purchase Header, and i cant seem to get an indirect permission to work, because i am not able to add the permission property to a page extension.

So i dont know what to do in this situation, i dont see a solution atm.

The code from page 662

    trigger OnAfterGetCurrRecord()
    var
        RecRef: RecordRef;
    begin
        ShowRecCommentsEnabled := RecRef.Get("Record ID to Approve");
    end;

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Keep userse from seeing Purchase Invoice, but be able to approve

    In that case you need to check if any approver id is maintained on the Purchase header, which I am not sure, so that you can write your logic only allow only those purchases which are going to approve.

    Thanks

  • Viggo VIL Profile Picture
    Viggo VIL 10 on at
    RE: Keep userse from seeing Purchase Invoice, but be able to approve

    Because by giving them read permission to Purchase header they would be able to see all the purchase invoices, and i only want them to see the once they need to approve.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Keep userse from seeing Purchase Invoice, but be able to approve

    If you want you can die the "Record" button by using Page extension of that page.

    Thanks.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Keep userse from seeing Purchase Invoice, but be able to approve

    Then you will have to build your own page.

    But is it not a bit weird that you want them to approve something you do not want them to have read permissions to?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans