Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

PURCHLINE VS INVENTTRANS RELATION

Posted on by Microsoft Employee

Hello, is everyline of purchline table have supposed to have a corresponding line on inventtrans table? 

The standart relation is :

purchline.inventtransid -> inventtransorigin.inventtransid -> inventtransorigin.recid -> inventtrans.inventtransorigin

or as in sql:

SELECT *
FROM dbo.PURCHLINE AS P
LEFT JOIN dbo.INVENTTRANSORIGIN AS I ON I.INVENTTRANSID = P.INVENTTRANSID
LEFT JOIN dbo.INVENTTRANS AS T ON T.INVENTTRANSORIGIN = I.RECID

I'm looking for some data corruption so i have to know if this structure is correct.

Regards.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,995 Super User on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Hi Sin5k4,

    You can try to set the Purchase order to the type of Journal. Save the record and then put back to type Purchase order. This Purchase type field is on the purchase order header.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Hello,unfortunately all these items are stocked products :(

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,995 Super User on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Hi Sin5k4,

    Can you indicate if the missing inventtrans records are related to items which are setup as service or the tick box Stocked product on the inventory model group is not enabled?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Thanks, now as part 2, if those records in inventtrans table do not exist, how can I recreate them?

  • Suggested answer
    Bashir Ahmad Profile Picture
    Bashir Ahmad 5,248 on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Correct You can use it ,

    also you can use InventTable  AS The InventTable table contains information about items.

    Query will be like:

    SELECT ID.RECID,P.RECID,PL.RECID, P.DATAAREAID,P.PURCHID,PL.DATAAREAID,PL.PURCHID , PL.INVENTDIMID , ID.INVENTLOCATIONID,pl.PURCHSTATUS   FROM PurchLine PL

    INNER JOIN PurchTable P ON P.PURCHID=PL.PURCHID

    INNER JOIN INVENTTABLE IT ON IT.ITEMID   = PL.ITEMID

       INNER JOIN INVENTITEMGROUPITEM ITG ON ITG.ITEMDATAAREAID = IT.DATAAREAID AND ITG.ITEMID = IT.ITEMID

    INNER JOIN INVENTDIM ID ON ID.INVENTDIMID = PL.INVENTDIMID

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,995 Super User on at
    RE: PURCHLINE VS INVENTTRANS RELATION

    Hi,

    This is correct. At creation of the PO line it creates the inventtrans origin and an inventtrans record. Note that due to e.g. partly delivery there can be more than ome inventtrans record related to the inventtrans origin.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,995 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,610 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans