Not sure if License or permission issue

Good Day Guys and Gals

I am attempting to paste rows into the Sales invoice Header table but I get the attached error, I was just wondering if this is a licence or permission issue.

I have super user access on the company so I don’t think it its a matter of permission.

Regards,

Jamie6886.Error.JPG

Hi James,

It’s both a license and permission issue.

It’s a permission issue in the way that the Sales Invoice Header (as well as any other standard posted table, including all the entry tables) is a protected table. You can only modify or insert into these tables indirectly using the standard posting codeunits. Even if you assign insert/modify permissions to the user, then it will not work here. The sales invoice header/line (and sales shipment header/line, sales cr. memo header/line and similar tables for purchase) are still a little different as they actually allow to be deleted, as long as they have been printed at least once. The logic behind this is that these tables are just for “storing” the documents until they have been printed (for customer and archive). After this they are not required, as they are not used for any statistics in the system).

It’s a license issue, as there is one exception. If you have a partner developer license, then you’re able to modify this table, so that you’re able to fix errors etc.

But when that has been said, then you should never try to insert directly into any of the protected tables. Always use the standard posting codeunits. So to insert a record into the sales invoice header, then you should insert it into the sales line/header and then post the invoice this way. Only here you will get all the related records, like g/l and customer ledger entries, registers, item ledger entries etc. created.

Thanks again Erik

so I should rather insert my invoice data to the sales header/lines tables? would the same be for sales orders and credit notes?

Hi James,

Yes, if you want to insert Sales Invoices into the system, then in order to get all related data created properly then you should insert them as sales headers/lines first and the call codeunit 80 to post them. Otherwise you would have to also create a lot of records in the rest of the system. Otherwise you might end up with a sales invoice in the sales invoice header/line tables, without having the related information. If you want to get a better understanding of what is related to a sales invoice, then open a sales invoice in the client and select the “Navigate” function.

And yes it would be the same for credit memo’s. And of course orders, which basically are just unposted invoices.

If you haven’t already, then you should read my blog post about which tables to use in Navision.