I have a Dynamics AX 2012 database only and I am looking in a way to make query to get ( sales order number from serial number)
witch tables should I search in ?
I have a Dynamics AX 2012 database only and I am looking in a way to make query to get ( sales order number from serial number)
witch tables should I search in ?
Yes, actually you can.
I will try,
Just one thing to make make sure.
Can I skip search in InventSerial as InventDim contains same info ?
The fact that all tables contain info doesn't mean that there exists a sales order for that Serial id.
I assume you can figure out what's the problem by looking at the data of the tables.
Start by one Serial Id, find the corresponding in InventDim, and then see if there's a SalesLine with that InventDimId.
Thanks for your reply,
I have tried that using the following query :
SELECT *
FROM [dbo].[INVENTSERIAL]
INNER JOIN [dbo].[InventDim] ON ([dbo].[INVENTSERIAL].[INVENTSERIALID] = [dbo].[InventDim].[INVENTSERIALID])
INNER JOIN [dbo].[SalesLine] ON ([dbo].[InventDim].[InventDimId] = [dbo].[SalesLine].[InventDimId])
where [INVENTSERIAL].[INVENTSERIALID]='XXX';
But I got empty record in return ( despite that all three tables contains info )
InventSerial contains the serial numbers.
Join it with InventDim (on InventSerialId).
And join InventDim with SalesLine (on InventDimId).
Sales order number can be found in SalesLine.SalesId.
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,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156