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