Smart data objects & browsers

mkb

New Member
Hi,

I have just started using V9 (although I have used 8 and 7 for about 3 years) and I am having a few problems with using a smart data object. I will use the sports database to illustrate my problem.

I want to create a smart data browser that will display 3 fields from the customer database table and two variables. I have create a smart data object using a freefrom query but I find that there does not seem to be away to add variables into the fields list or anywhere in the smart data object. I believe if I create the smart data object using a temp-table like the database table I can add variables to this temp-table. Is this the best way to go?

What I want to do is display values in the two variables from an outside program that does all the calculations once I pass it the relevant details from the customer table. Do all of these calculations need to be done in the smart data object or in the smart data browser. Am I even using the correct smart objects to go about doing this.

Any help is greatly appreciated.

Thanks.
 
There are occasions when using a variable in a browser can be useful, but this isn't one of them, as far as I can see.

If you really must use variables (not an elegant solution) then the only way that you can show the correct values according to the browse row, is to reassign them as the rows are being displayed. e.g. within the ROW-DISPLAY trigger of the browser.

A far better solution, is to use a temp-table that consists of all of the columns that you want to display. You can then populate the temp-table in the SmartDataObject, performing the necessary calculations for each row. This places the application logic in the most logical place and keeps it self-contained, reusable and easy to maintain.
 
Top