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

Notifications

Announcements

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.

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

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

  • Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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 ?

  • Mea_ Profile Picture
    60,286 on at

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

  • Community Member Profile Picture
    on at

    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
    60,286 on at

    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.

  • Suggested answer
    AJJAIS Profile Picture
    on at

    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.

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 679 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 292 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans