How to Create Query

Hi Master,


I want to create a Query in AX 2012, I have tried a query on SQL, I want to implement SQL code to Query AX 2012.

I have a problem, when I have made the query, the data should appear 4 lines, but when in View in AX 2012 the data show 12 lines.

How I can create query like code SQL below ? Please advice 



*Query SQL


*Properties in Query AX 2012 (what i have to change ?)


  • Hi Pranyoto,

    the SQL query can be converted to AX query like this, please try with this.



    select PurchId, ItemId from purchLine
            join purchTable
                where purchLine.PurchId == purchTable.PurchId && purchLine.PurchId == 'PO1700006006'
                    join vendPackingslipTrans
                        where purchLine.InventTransId == vendPackingslipTrans.InventTransId
                            join vendPackingSlipJour
                                where vendPackingslipTrans.PackingSlipId == vendPackingSlipJour.PackingSlipId
                                    join vendInvoicePackingSlipQuantityMatch
                                        where vendPackingslipTrans.SourceDocumentLine == vendInvoicePackingSlipQuantityMatch.PackingSlipInvoiceSourceDocumentLine
                                            join agitPobranchView
                                                where agitPobranchView.PurchId == purchLine.PurchId
                                                    join agitPobussinesunitView
                                                        where agitPobussinesunitView.PurchId == purchLine.PurchId
                                                            join agitPochanelView
                                                                where agitPochanelView.PurchId == purchLine.PurchId;

Reply Children