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)

how to fill a form the opens when a button is clicked with the values coming from the record in the grid that i'm standing at. AX 2012

(0) ShareShare
ReportReport
Posted on by 1,552

I have a grid that contains 3 fields: x,y and z and are filled according to the selected line in the grid. I also have a button above the grid, when clicked a new form appears that contains the same fields x and y but empty. What i need to do is that when i click the button these two fields needs to be filled with the same data as the grid. This is what i did:

void clicked()

{
Args args;
FormRun formRun;
super();
args = new args();
args.record(projCostTrans);
args.name( formstr( Updatee ) );
formRun = classFactory.formRunClass( Args );
formRun.init();
formrun.run();
formrun.wait();
formRun.detach();
TmpTable_ds.research();
TmpTable_ds.executeQuery();
ProjCostTrans_ds.refresh();
ProjCostTrans_ds.executeQuery();

}

public void init()
{
ProjCostTrans projCostTrans;
super();

projCostTrans=element.args().record();
TmpTable.x=ProjCostTrans.x;
TmpTable.y=ProjCostTrans.y;
TmpTable_ds.research();

TmpTable_ds.executeQuery();
}

when i debug i  can see that the tmp table is filled but the form is still empty, is it something about refresh? plus does my code contain extra things that are not needed?

*This post is locked for comments

I have the same question (0)
  • Ghetz Profile Picture
    3,029 on at

    Not sure you are taking the correct approach, but for starters you could try actually inserting the data. (TmpTable.insert())

    I recommend you check out how standard forms with similar behaviour are programmed and follow the same pattern.

    Also search for posts about using temp tables in forms like this one

    [View:https://community.dynamics.com/ax/b/dynamicsaxinsightbyanas/archive/2014/08/20/ax-2012-using-temporary-table-as-form-s-datasource]

  • Suggested answer
    zeeshan.shaikh Profile Picture
    683 on at

    Hi,

    Please make sure you have filled the grid data source property with the TmpTable DS on your Updatee.

    You can also set your fields in InitValue method under form data source methods.

    Also, i would recommend to follow best practices while doing this task.

    Regards,

    Ali Zeeshan

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
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans