Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Copy data from VendAgingReportTmp table to a regular table

(0) ShareShare
ReportReport
Posted on by

Hi,

I am new to AX. I have a requirement where I need to export the data displayed in Vendor Aging Report to a sql database. Ideally, I want to copy the data in VendAgingReportTmp table to a physical table and export it to my database. Is there any way I can copy this data before it is deleted from the temp table. I have tried using the Buf2Buf method in a runnable class but that seems to be not working. Any help is appreciated.

Bottomline , I need a way to copy temp table data of ssrs reports to a regular table before the data is lost from the temp table.

Thanks.

  • Suggested answer
    AJJAIS Profile Picture
    AJJAIS on at
    RE: Copy data from VendAgingReportTmp table to a regular table

    Looks like, you are trying to Export Customer Aging and importing to database other than AX database. If you want that you can generate Customer Aging existing report with the parameters as per business need and save the report into file csv/excel. Once you have the Customer Aging report as a file, create a new database table directly and import the file. This will help you to save file data to database table.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Copy data from VendAgingReportTmp table to a regular table

    I can see that you pass RecordInsertList  to agInsertVendAgingReportTmp

     public  void agInsertVendAgingReportTmp(boolean _reverseAmountsAndHeadings, RecordInsertList _tmpTableRecordList)

    but there is no code to insert record in it.

  • RE: Copy data from VendAgingReportTmp table to a regular table

    The table is a regular table where I have cloned the fields from VendAgingReportTmp table. I have declared in in the second line of above code and added the buffer into insertRecordset. Do you see an error in the way I have done it ?

    Thanks for the response.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Copy data from VendAgingReportTmp table to a regular table

    Is agCopyVendAgingReportTmp temp table or regular one? Also I do not see where you declare it and where you add it into insertRecordset.

  • RE: Copy data from VendAgingReportTmp table to a regular table

    public class AgCopyTmpData_VendAging  

    {

       VendAgingReportContract contract= new VendAgingReportContract();

       AgCopyVendAgingReportTmp agCopyVendAgingReportTmp ;  

       public static void main(Args _args)

       {

           AgCopyTmpData_VendAging agCopynew = new AgCopyTmpData_VendAging();

           boolean reverseAmountsAndHeadings;

           AgCopyVendAgingReportTmp agCopyVendAgingReportTmp;

       RecordInsertList recordInsert = new RecordInsertList( tableNum(AgCopyVendAgingReportTmp),false,true,true,false,false,agCopyVendAgingReportTmp);

           agCopynew.agInsertVendAgingReportTmp(reverseAmountsAndHeadings,recordInsert);

       }

       [Wrappable(true)]

       protected final ColumnTxt headingDate()

       {

           switch (contract.parmDateTransactionDuedate())

           {

               case DateTransactionDuedate::DocumentDate:

                   return "@SYS2587";

               case DateTransactionDuedate::TransactionDate:

                   return "@SYS67";

               case DateTransactionDuedate::DueDate:

                   return "@SYS14588";

               default:

                   return "@SYS14588";

           }

       }

       public  void agInsertVendAgingReportTmp(boolean _reverseAmountsAndHeadings, RecordInsertList _tmpTableRecordList)

       {

           agCopyVendAgingReportTmp.AccountNum="@SYS24500";

           agCopyVendAgingReportTmp.HeadingDate=this.headingDate();

           agCopyVendAgingReportTmp.AsOfDate=strFmt("@SYS84682", date2StrUsr(contract.parmBalanceAsOfDate(), DateFlags::FormatAll), contract.parmDateTransactionDuedate());

           agCopyVendAgingReportTmp.Balance=

       }

    }

    I tried inserting data the above way but it doesn't work. Am I doing it right ?

  • RE: Copy data from VendAgingReportTmp table to a regular table

    Can you elaborate w.r.t VendAgingReportTmp table data on how I can achieve that ? What data should I be assigning to the physical table i cloned ?

    Apologies if this is a too basic question but I am a fresher and very new to AX. Thank you.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Copy data from VendAgingReportTmp table to a regular table

    you can always assign fields one by one and insert data, did you try that?

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…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans