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...
Answered

Stopping users from inserting G/L accounts in purchase lines

(6) ShareShare
ReportReport
Posted on by 305
Hello, 
 
I need to stop users from being able to insert G/L account in purchase lines. They should still be able to read, modify and delete purchase lines. I have tried a couple of things, but can't get it to work as wanted. 
 
Can anybody help?
 
Thanks

Alejandra
I have the same question (0)
  • Verified answer
    Ben Baxter Profile Picture
    6,575 Super User 2025 Season 2 on at
    Excluding access to the G/L Account TableData via Permissions will make it where the G/L Account lookup is a blank list, they won't be able to select an Account.
     
    Let me know if this resolves your question.  If so, please mark it as a Verified Solution.
     
    Best Regards,
    Ben Baxter
    Accent Software Inc
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    Hi,
    You can try this code.
    tableextension 50100 PurchaseLineTableExt extends "Purchase Line"
    {
        fields
        {
            modify("G/L Account No.")
            {
                trigger OnBeforeValidate()
                begin
                    if Rec."G/L Account No." <> xRec."G/L Account No." then
                        Error('You cannot modify the G/L Account No. on purchase lines.');
                end;
            }
        }
    }
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,347 Super User 2025 Season 2 on at
  • Verified answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    Hi, I think using Security Filters should be the easiest way, which does not require customization.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,527 Super User 2025 Season 2 on at
    Removing edit and modify permissions from the permission set would be the easiest way.
     
     
    If this helped you, please check the box Does this answer your question?
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,631 Super User 2025 Season 2 on at

    Certainly! To restrict users from inserting G/L accounts in purchase lines while still allowing them to read, modify, and delete purchase lines in Business Central, you can follow these steps:

    1. Permission Sets:

      • Create a new permission set that excludes access to the G/L Account TableData. This will prevent users from being able to select or insert G/L accounts in purchase lines.
      • Go to Permissions in Business Central and create a new permission set.
      • Add the necessary permissions for reading, modifying, and deleting purchase lines.
      • Exclude the G/L Account TableData by setting the permissions to None for Insert.
    2. Assign Permission Sets:

      • Assign the newly created permission set to the users who should have restricted access.
      • Ensure that these users do not have other permission sets that might override these restrictions.
    3. Form Customization:

      • Customize the purchase line form to hide or disable the G/L account field for the specific user roles. This can be done through the form design options in Business Central.
    4. Validation:

      • Test the setup by logging in as a user with the restricted permission set to ensure they cannot insert G/L accounts but can still read, modify, and delete purchase lines.
  • CU11021601-0 Profile Picture
    4 on at
    As per my understanding of your question you want to restrict user from adding other than FA & Item type in purchase invoice line before posting,
    you can extend purchase invoice subfom page and write your logic inside oninsert & on modify trigger.
  • Verified answer
    AleAlonso Profile Picture
    305 on at
    Hi all, 
    Many thanks for all your help. I did not want to use code or removing permission to GL accounts. I managed to do it with two permission sets and a security filter, the first one insert only access with security filter: type not equal G/L account in table data 39
     
     
     
    Second permission set indirect insert permission to table data 39
     
     
    Thanks
     
    Alejandra

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,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans