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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

I am trying to populate a form grid with a temprory table which is set as form's datasource

(0) ShareShare
ReportReport
Posted on by 97

I have a requirement such that i have a form which contains PO id as a listbox.

In action pane i have a find button.

Below the field there is a grid which is populated by a temprory table(filtered according to PO)

68520.Capture.PNG

the requirement is such that when i select a PO number and click on find button the corresponding lines should be populated in the grid.

Issue:  when i set table as regualr data is populated correctly but as temprory table it disappears.

code: 

in clicked method of find 

void clicked()
{

//Need to pass the parameter here to fetch the data in a grid
ABC_TMPPurchtData.setTmpData(element.fetchData(dialogPONumber.text()));

ABC_TMPPurchtData_ds.executeQuery();
}

fetch data method 

public CBO_TMPPurchtData fetchData(purchId _PurchId)
{

PurchTable purchTable;
PurchLine purchLine;

while select purchTable
Join purchLine where purchTable.PurchId==purchLine.PurchId
&& purchTable.PurchId==_PurchId

{
tMPPurchtData.PurchId=purchTable.PurchId;
tMPPurchtData.LineNumber=purchLine.LineNumber;
tMPPurchtData.ItemId=purchLine.ItemId;
tMPPurchtData.OrderAccount=purchTable.OrderAccount;
tMPPurchtData.insert();

}

return tMPPurchtData;

}

*This post is locked for comments

I have the same question (0)
  • Rustem Galiamov Profile Picture
    8,072 on at

    Hi!

    Your code is strange. You trying setTmpData of CBO_TMPPurchtData to ABC_TMPPurchtData.

    Or ABC_TMPPurchtData is just the name of form's CBO_TMPPurchtData data source table?

  • Palak jain Profile Picture
    97 on at

    void clicked()

    {

    //Need to pass the parameter here to fetch the data in a grid

    ABC_TMPPurchtData.setTmpData(element.fetchData(dialogPONumber.text()));

    ABC_TMPPurchtData_ds.executeQuery();

    }

    fetch data method

    public ABC_TMPPurchtData fetchData(purchId _PurchId)

    {

    PurchTable purchTable;

    PurchLine purchLine;

    while select purchTable

    Join purchLine where purchTable.PurchId==purchLine.PurchId

    && purchTable.PurchId==_PurchId

    {

    tMPPurchtData.PurchId=purchTable.PurchId;

    tMPPurchtData.LineNumber=purchLine.LineNumber;

    tMPPurchtData.ItemId=purchLine.ItemId;

    tMPPurchtData.OrderAccount=purchTable.OrderAccount;

    tMPPurchtData.insert();

    }

    return tMPPurchtData;

    }

    sorry that was a typing mistake of mine that was not the issue, the issue is what i mentioned

    when i set table as regualr data is populated correctly but as temprory table it disappears.

  • Rustem Galiamov Profile Picture
    8,072 on at

    Did you have any data source table joined to your ABC_TMPPurchtData?

  • Palak jain Profile Picture
    97 on at

    its a temprory table with same name ABC_TMPPurchtData i have created the same object.

    By the way the code is working fine now as settmp method works with inmemory type.

    Now there is another issue everytym i select a new po and click on find it appends the last tym searched data.

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Put the delete_from tMPPurchtData

        PurchTable purchTable1;
        PurchLine purchLine;
    
        delete_from tMPPurchtData;
    
        while select purchTable1
            join purchLine 
            where purchTable1.PurchId == purchLine.PurchId
               && purchTable1.PurchId == _PurchId
    
        {


  • Palak jain Profile Picture
    97 on at

    Thnaks alot it worked.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans