Steve,

many thanks for taking the time to come up with your suggestions.
 
> Have not done any 4D in a couple years so I can't test my theories, or even
> want to try to write pseudo code.

Interesting, that a lot of A4D users don't have a full fledged 4D app
running and use A4D to make it accessible from the internet as well but
create web applications in A4D using 4D solely as a database engine like a
kind of MySQL substitute.

Given 4D's restrictive license policy, that wouldn't have been the first
thing I'd look at for sole web applications.
 
> First of all have you tried a callbacks? Don't think it is called until the
> record is  loaded, i.e. the selections is not messed up when you're building
> the rowset. Might even be able to do it with a column callback.

Yes, callbacks was the first thing I tried but you get complete garbage
within the rowset, if you issue a query for the table you build the rowset
from within the callback.

> Another approach, if there are not thousands or related records is query the
> related records (you mentioned a label, or maybe a non-zero id)
> 
> Look through the selection and suff the data you need into a collection with a
> key being the related id (as string).  You'd have access to the related
> collection (build where rowset is built) so don't even have to put it in a
> column. If the row has a related record, just use the related_id as string to
> get the other columns and do what you need to do.
> 
> if($row{"related_id"} > 0
> $row{"field3"}  := $rel_coll{string($row{"related_id"})}{"field3"}
> 
> end if

That would work.

The only thing I do not like with that approach is, that I have to
substitute a lot of rowset fields in case there is a related record.

Well could probably do it within a method or use a pointer to the rowset, if
that is possible in A4D.

Currently I'm rethinking my database design, so I'll probably can circumvent
the need to access related records from the same table.

Peter


_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to