Showing posts with label Get product receipt details from posted invoice. Show all posts
Showing posts with label Get product receipt details from posted invoice. Show all posts

Wednesday, June 24, 2026

Get product receipt details from posted invoice

 code:-

sql:-

select DISTINCT vendPackingSlipTrans.PACKINGSLIPID from vendInvoiceTrans

inner join vendInvoiceJour

  on vendInvoiceTrans.PurchID = vendInvoiceJour.PurchId and

      vendInvoiceTrans.InvoiceId = vendInvoiceJour.InvoiceId and

      vendInvoiceTrans.InvoiceDate = vendInvoiceJour.InvoiceDate and

      vendInvoiceTrans.NumberSequenceGroup = vendInvoiceJour.NumberSequenceGroup and 

      vendInvoiceTrans.InternalInvoiceId = vendInvoiceJour.InternalInvoiceId

  inner join vendInvoicePackingSlipQuantityMatch

      on vendInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLIne = vendInvoiceTrans.SourceDocumentLine

  inner join vendPackingSlipTrans

      on vendPackingSlipTrans.SourceDocumentLine = vendInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine

  and vendInvoiceJour.LEDGERVOUCHER='pass your journal vocuher'


and also if you want reverse like if you have grn get invoices then code

sql:-

select vendPackingSlipTrans.DATAAREAID,vendPackingSlipTrans.ORIGPURCHID,vendPackingSlipTrans.PACKINGSLIPID,vendInvoiceTrans.INVOICEID from vendPackingSlipTrans
inner join vendInvoicePackingSlipQuantityMatch
on vendPackingSlipTrans.SourceDocumentLine = vendInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine
inner join vendInvoiceTrans
  on vendInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLIne = vendInvoiceTrans.SourceDocumentLine
  and vendPackingSlipTrans.ORIGPURCHID='passpurchid'and  vendPackingSlipTrans.DATAAREAID='pass dataareaid'

 

Custom services in d365fo

 In this blog we see how to develop custom services in d365fo Mainly we need to develop 1) Request class 2) Response class  3) service class...