Design a tempTable in class to hold a "matrix" of values

In another post I got to, by the great help of Martin, a solution with a TempTable to hold values.

In post https://dynamicsuser.net/ax/f/developers/96205/memory-not-cleaned-with-struct you can see the discussion

So I want to create a class of a TempTable and then GetSettermethods to get and set the values in the table.

If I'm not wrong I can do that by (assume I created a class of type TempTable named "Commodity" 

public real parmOpen(int _id, real _open = 0)
{

//update value

if(_open != 0)

{

select forupdate Commodity where Commodity.id == _id;
commodity.open = _open;

commodity.update();

}

return commodity::find(_id).open;

}

Wrote it form the top of my head, but its about the concept.

What do you think?

Parents Reply
  • I wouldn't ever put such business logic to a form, but all right, let's ignore it this time.

    Thanks ;)

    So TmpTable it is. That means that I have to shift from just populating and read variables, the methods change to "Select forupdate tmptable" and "table.insert()" etc.

    Now I worked with TmpTables before (in the other business unit we use Axapta) and in that case I also used the TmpTable in a form (sorry ;)

    So knowledge is there how to handle it.

    Now I'm questioning.

    Should I use in this case the TmpTable as a Global object in the form, or is the better way to create a class which will create TmpTable and get/set all the data? I prefer a Class so doing it on "higher level" and on a smart way. 

    Pls advise

Children
Related
Recommended