Open Forum

 View Only
  • 1.  Permission to Update Sales Shipments Header added columns

    Posted Nov 15, 2020 12:04 PM
    #D365BusinessCentral. #Technical

    Dear Business Central experts,

    How to update a column that we added ourselves to the "Sales Shipment Header" table?
    We are writing an extension for our own BC tenant, it adds a column to the "Sales Shipment Header" table.
    It is desired that we can update this column for shipments that have been posted earlier to the table.

    When testing my extension, I get an error message that says:
    "You do not have the following permissions on TableData Sales Shipment Header: Modify. (...)"

    My permission set is SUPER, my License is "Internal Administrator Dynamics 365 Business Central Essential".

    I can see the new column that I added in Visual Studio, I can also read the default value that is automatically put there, I just cannot change that default value.

    Sorry I am a bit of a newbie when it comes to permissions, though I've been writing AL for a few months now.
    I have these questions:
    - Is it normal that I cannot update the Sales Shipment Header table with the above given permission situation?
    - Why does the lack of permission also apply to columns that we were able to add ourselves?
    The added column is not much use if I cannot update it.
    - Is there a way around it?​​
    Thanks in advance!
    and, with best regards,

    Wolter Kaper
    Entocare C.V.

  • 2.  RE: Permission to Update Sales Shipments Header added columns

    Posted Nov 16, 2020 08:39 AM
    Shipment Header (and Lines) are protected tables that your license will not allow you to write to directly (through a page).  You can post things to these tables indirectly (license does allow for that).

    A few ways to fix this but all come down to having your partner add permission to do this.

    There is a property on all objects called Permissions. Your Partner needs to add permission Shipment Header=m to the specific page you are modifying.  Then you will need to make all the fields not editable except for the one new field you have added.  An example of this can be seen on Page 25 Customer Ledger Entries.  If you do not make all the fields Editable = False then they will be able to edit those as well which should not be allowed.

    The other way to do this is through code and using the Permission property.  See Codeunit 391 Shipment Header - Edit and Page 130 Posted Sales Shipment or Page 5975 Posted Service Shipment for examples of this (look at the OnModifyRecord trigger for the code).

    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME

If you've found this thread useful, dive deeper into User Group community content by role