How to passed related values of a foundset into a column of the parent table as string?
I’ve been trying to find an answer in the forum, but I’ve been unsuccessful. I am sure the answer is there somewhere, but perhaps I am asking the wrong question to Google and in this forum’s search.
Anyway, I need to pass the related values from column-b1 and column-b2 of Table-B, into column-a3 of Table-A as a string (simple text).
Doing this is not complicated at all if Table-A and Table-B were related in an one-to-one relationship. The problem is that these tables are in an one-to-many relationship.
In other words, the records of Table-A has many related records in Table-B. I need to pass the values of the column-b1 and column-b2 (of each related record) into a the column-a3 (of Table-A).
IF the relation were an one-to-one relation, something like this would work (btw, all of the columns are of the same data type, text):
The problem is that the relation is an one-to-many relation, and I need to pass all of the values of the columns b-1 and b-2 (of all the related records) of Table-B into the column-a3 of the Table-A (in a form of string, as simple text).
We can do it with found set find and search also. Get the Table b found set and apply the conditions and then we will get all the column b1 and column b2 records and then we can convert foundset to dataset then use Dataset.getAsText(’ ‘,’ | ‘,’',true) and update to the column a3.
Use this if you are not willing to use calculation.
Great tips guys. Thank you very much. I’ll put them in my notes.
However, I couldn’t use any of these two approaches for the issue I needed to resolve because the data were various levels deep.
The queries are pretty complex (no like the one in the example above) and I needed to do things like DISTINCT and ORDER BY, etc. I know Servoy offers way to do these things, but it was much more efficient and easier to do this by query -given the requirements (IMHO).
Again, thanks. Really good tips. Parsing data here and there is something new for me :-/