on 2022 Dec 22 5:15 AM
I have an addon running and I am trying to get the last DocNum of an approved invoice in SAP B1.
For example if 2 invoices have been approved, the DocNums show to be the same once approved but before that are added as documents.
I use the query below to fetch the last DocNum:
rs.DoQuery("SELECT MAX(T0.\"DocNum\") AS \"DocNum\" FROM OINV T0 INNER JOIN NNM1 T1 ON T0.\"Series\" = T1.\"Series\" WHERE T0.\"BPLId\" = '" + branch + "'");
rs.MoveFirst();
The problem with this is that it returns the same document number for the 2 invoices that I add back to back.
Is there a way to get the just added document in SDK. Invoices are not being added through the addon, they are added through the regular add button but I need to catch the proper Document Number just added.
Request clarification before answering.
User | Count |
---|---|
90 | |
8 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.