how to store display method values in variables?

i am writing display method in datasource and drag and drop the display method in grid. but display method cannot store in table. i want to store the display value in table.

You need to add an actual field to the table to store the data. Merely creating a display method and displaying it on the form will not work. At that point you will need to put the data into the table.


A dirty but possible way to solve your problem:

1 on the drag and drop event, call an insert() method in your table

2 add the display method in your insert() to fill the field value that was populated by the display method

Hope it helps



Sry i cant get u clear , can u explain very clearly

Thomas please can you explain it more clearly. its important to know.


As I said, I gave a dirty way to solve the problem,I haven’t deepen the problem, I only use drag’n drop objects on treeview controls, I think it’s quiet the same on display method.

You should have a look at AOT/Forms/tutorial_Form_TreeControl, it might give some ideas,

for exemple using grid controls instead of using tree controls.

Hope it helps



I would not do as Thomas said. Either way, you need to add the field to the table in order to store the data. On the form data source or the table itself, you can put code in the .initValue() method to initialize certain values. Putting the field on the table will allow you to filter by it too.

Otherwise, you can use a display method if it is merely for data display only.

i have same problem facing, i have define variable and calculate the value and what to show in the form grid but its showing last value in all rows so if u have any solution then pls suggest me.

Thanks & Reggards

Hi.Create a field and write a job like this;

tablename tablename;

while select forupdate tablename


tablename.newfield = tablename.dispmethod()


then when the display method modified, write a modified method like this;



Tablename.newfield = Tablename.displaymethod();


But if you modified a field in different tabpage and your display method is another tabpage it isnt work.You must call Tabpage.pageactivated() because you cant get last modified record.İ only know this maybe its helpful.