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

  • Martin Dráb Profile Picture
    231,760 Most Valuable Professional on at
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    MSDN: while select Statements [AX 2012]

  • srinivas pamidi Profile Picture
    1,737 on at
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    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
    231,760 Most Valuable Professional on at
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    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
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    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
    231,760 Most Valuable Professional on at
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    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
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    thank you it is working.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: how to fetch the docuref table data with respect to purchase order in PO Report

    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));

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans