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
  • Please use Insert > Insert Code to paste source it. It'll preserve indentation, which will make your code much easier to read. If you want others' help, you shouldn't make it too complicated for them.

    I've also updated a few other things in your code according the usual code style.

    public real parmOpen(int _id, real _open = 0)
    {
    	Commodity commodity;
    
    	//update value
    	if (_open != 0)
    	{
    		select forupdate commodity where commodity.Id == _id;
    		commodity.Open = _open;
    		commodity.update();
    	}
    
    	return Commodity::find(_id).Open;
    }

    You said you created "a class of type TempTable named Commodity", but that's not true. Commodity is a table, not a class.

    Note that I don't know what you're asking about. Also, you showed us a method but didn't say in which class or table it's defined. Such context is crucial.

Reply Children
Related
Recommended