Hi there,
I'm struggling with something. I have a sales order and when I choose to 'post and send', I select 'ship and invoice' after I finish all the steps I get the error message 'Insufficient inventory'. But still a posted sales invoice is created with 0 value lines. How can I stop the post and send if there's no items inventory. I'm pretty new in AL language I have a project and already have an extension on the sales order page.
Any help will be appreciated.
Thanks in advance.
The commit was the problem indeed here's my code:
Table extension: SalesInvoiceShipping extends "Sales Invoice Header"
Codeunit UpdateRef:
I think it is the "Commit" problem, I suggest to remove this Commit.
If it freezes, there may be an infinite loop in processing , and you should investigate that.
Although it is more troublesome, if you debug step by step, you should be able to find the cause of the problem.
Hope this helps.
Thanks.
ZHU
Maybe you should try to share the code that you have written?
Hi I think you are right we have some customisations. I have an after insert trigger on "Sales Invoice Header" and there I do a commit. But the error comes after this action and the SalesInvoice is already committed. But when I remove the commit from this after insert in the correct situation (with no error), the app freezes and nothing happens. Have you got any idea why this is?
You can set "Prevent Negative Inventory" on the item to Yes.
Hi, This appears to be a customization issue.
You can step through the debugger to see when the sales invoice was created but not rolled back when the error was reported.
This may be related to Commit method or temporary tables.
Hope this can give you some hints.
Thanks.
ZHU
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156