Perplexing Permissions Problem

lloydsmods
Member Posts: 93
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.
The problem is that when attempting to modify the sales invoice lines, we receive a permissions error:
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 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.
0
Comments
-
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)0 -
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:0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions