web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

query to read vendor invoice journals with attachments

(2) ShareShare
ReportReport
Posted on by 401
Hello
I am building an inquiry to list Invoice journals that does not have associated attachments. I have already taken LedgerJournalTable as primary data source and dynamically joined  the table Docuref using the fields RecId and RefRecid with ranges on docuref table fields RefTableId and RefCompany using NotExists join. This is only filtering partial data and not working correctly. Any suggestions please
 
Thanks
SKO
I have the same question (0)
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    Please tell us more about your query and the problem ("not working correctly" is too vague).
     
    For example, show us SQL code generated by your query or at least screenshots of your query definition.
  • SKO Profile Picture
    401 on at
    This is the query I am using and the form does not show all the journals that doesn't have attachments
     
    SELECT FIRSTFAST FORUPDATE * FROM LedgerJournalTable(LedgerJournalTable)
    USING INDEX TypeNumIdx
    WHERE ((JournalType = 10) NOTEXISTS JOIN FORUPDATE 'x' FROM DocuRef(DocuRef_1)
    WHERE LedgerJournalTable.RecId = DocuRef.RefRecId AND ((RefCompanyId = N'XXX'))
     
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    An obvious problem is that you don't have a filter for RefTableId. Please fix that before spending more time with the investigation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans