Edit custom field on Sales Invoice Header easy way?

Hi All
To edit a field I have to follow how MS done with codeunit 1409 "Sales Inv. Header - Edit" and special page (update) . I'm wondering if there is an easier way to create a field that can be edited from front or back end like in sales order

Answers

  • txerifftxeriff Member Posts: 514
    Hi,
    That codeunit is to edit data from posted documents as the codeunit has the permissions:
    Permissions = TableData "Sales Invoice Header" = rm;

    If you want to add a new field to sales order you would need to create an extension for it.
  • samantha73samantha73 Member Posts: 109
    So my question is after creating a new field via extension do you still have to create the update logic similar to codeunit "Sales Inv. Header - Edit" or can you make the field editable only. Making the custome fields editable did not work
  • txerifftxeriff Member Posts: 514
    edited 2025-01-13
    samantha73 wrote: »
    So my question is after creating a new field via extension do you still have to create the update logic similar to codeunit "Sales Inv. Header - Edit" or can you make the field editable only. Making the custome fields editable did not work

    If you are trying to edit posted invoice then yes, you need to create a similar codeunit as codeunits can't be extended, or looking into the standard code there is an event publisher you can use:
    OnRunOnBeforeAssignValues(SalesInvoiceHeader, Rec);

    I wouldn't recommend to allow editing posted documents at all apart from what BC standard offers.

    In your original question you were talking about a sales order, this is an unposted document.

    You may need to clarify your question.

Sign In or Register to comment.