I have a client that needs to be able to re-invoice charges that have already been invoiced and posted. Once a credit memo is created, the solution I came up with was to remove the invoice number from the charges and then to remove a batch number from the sales invoice header and sales invoice lines. The field, "PW Batch", has been added to the table and is populated when the Sales Invoice is created.
IF lSalesInvoiceHeader.GET(lInvoice) THEN
BEGIN
lSalesInvoiceHeader."PW Batch":='';
lSalesInvoiceLines.SETRANGE(lSalesInvoiceLines."Document No.",lInvoice);
IF lSalesInvoiceLines.FIND('-') THEN
BEGIN
lSalesInvoiceLines.MODIFYALL("PW Batch",'',FALSE);
END;
lSalesInvoiceHeader.MODIFY(FALSE);
END;
The problem is that when attempting to modify the sales invoice lines, we receive a permissions error:
"You do not have permission to modify records in the Sales Invoice Lines table."
This, despite having the SUPER role which gives read, write, modify, delete and execute permissions for all TableData. When I switch to my developer license, the function works perfectly.
If guns cause crime mine must be defective.
Comments
If you use a Developers license, you can modify this table without setting the permissions. With a customer license, you need to set the permissions first.
Perhaps there is another solution.
-
-
You can look at Codeunit 391 - to make your new field "PW Batch" editable
**OOPS** thats for the header :oops:
http://www.BiloBeauty.com
http://www.autismspeaks.org