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 :
Microsoft Dynamics AX (Archived)

how to fetch the docuref table data with respect to purchase order in PO Report

(0) ShareShare
ReportReport
Posted on by 1,737

hai,

i want to fetch the notes field from the docuref table in the Purchase order Confirmation Report, 

but i didn't find out the Relation Between These two tables,

how to solve these issue.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Every attachment is reference in DocuRef in following relation.

    DocuRef.RefTableId

    DocuRef.RefRecId

    In your case if you are fetching Notes attached to PO.

    PurchTable           purchTable;

    DocuRef               docuRefLocal;

    select firstonly purchTable where purchTable.PurchId == 'XXXXXX';

    select firstonly docuRefLocal

    where docuRefLocal.RefTableId == purchTable.TableId

    && docuRefLocal.RefRecId == purchTable.RecId

    && docuRefLocal.TypeId == 'Note';

    info(strfmt('%1', docuRefLocal.Notes));

  • srinivas pamidi Profile Picture
    1,737 on at

    thank you it is working.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    I marked the verified answer for you, so everybody can see that the problem has been resolved and can easily locate the answer.

    Please do it by yourself next time.

  • srinivas pamidi Profile Picture
    1,737 on at

    hai qureshi,

    it is fine for only one Note in the document handling.

    how to get the Two or more Notes.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    The relation is exactly the same for more records. If you want to fetch more records, use while select. You'll find details in documentation.

  • srinivas pamidi Profile Picture
    1,737 on at

    hai martin,

    i am writing this following code i am getting only one note in the Purchase order Report.

    select purchTable where purchTable.PurchId == PurchId;

               select docuRef

               where docuRef.RefTableId == purchTable.TableId

               && docuRef.RefRecId == purchTable.RecId

               && docuRef.TypeId == 'Note';

    now tell me where add the "while " in that code.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    MSDN: while select Statements [AX 2012]

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans