Perplexing Permissions Problem

lloydsmodslloydsmods Member Posts: 93
edited 2007-05-04 in Navision Attain
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

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You have to set Write-permissions to the "Sales Invoice Line" table using the Permissions-property. You set this property on the object, where you put your C/AL Code to modify the Sales Invoice Line table.

    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.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SavatageSavatage Member Posts: 7,142
    Just Curious IF You Could Elaborate On This?
    I have a client that needs to be able to re-invoice charges that have already been invoiced and posted
    .
    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:
Sign In or Register to comment.