Rudy,
SalesLine.LineNum and PurchLine.LineNum ARE NOT UNIQUE within an order.
Given a large enough order and enough edits, you will find duplicated line numbers. Depending on whether the user uses a down arrow or control-n to add lines, they can create line 1.0, then 0.5, 0.25, 0.12, 0.06, 0.03, 0.02, 0.01, 0.01, 0.01, etc. It's rare, but it will happen sooner or later.
You should be keying off LotID (InventTransID) as it is kept unique for the table by index.
Never use LineNum in a where clause: been there, got burned, still have the scars 8^)
------------------------------
Andrew Ford
Lead AX Developer
Nivel Parts & Manufacturing Co., LLC
Jacksonville FL
------------------------------
Original Message:
Sent: 04-04-2018 02:46 PM
From: Rudy Salcedo
Subject: Sales Line Invoiced but not showing as invoiced
We're on AX 2012 R2, and sometimes an SO line will get invoiced and for some reason will get stuck at Open or Delivered status. We haven't found a way to change the line to Invoiced via any AX UIs, so when this happens, the user gives us the SO# and SO line# and tells us the line needs to be flipped from Open/Delivered to Invoiced. Then we run a SQL statement in SQL Server Management Studio like the following:
UPDATE SALESLINE
SET SALESSTATUS = 3 -- 3=Invoiced
WHERE SALESID = '12345678SO'
AND LINENUM = 1.00000
Maybe this will work for AX 2012 RTM too.
------------------------------
Rudy Salcedo
Senior Programmer/Analyst
LaForce, Inc
Green Bay WI
Original Message:
Sent: 04-03-2018 04:27 PM
From: Lori Holmes
Subject: Sales Line Invoiced but not showing as invoiced
Hello everyone. We are on AX 2012 RTM.
We have a Sales Order that had one line for a qty of 10 pcs.
We shipped and invoiced 3 out of 10 pcs.
The item number changed - so we added a new line with the new item number for a qty of 7 pcs, then changed the original line from 10 pcs to 3 pcs.
The original line is now not showing as invoiced for the 3 pieces which were shipped against it. The line shows open for 3 pieces. The invoice is in the Invoice journal on the Sales Order. How can we get the line to show as invoiced again so this Sales Order can be reflected properly.
Thank you,
Lori
------------------------------
Lori Holmes
Bridgewater, NJ
LHOLMES@hamamatsu.com
------------------------------