PeterMu
I'm new here

Retrieving values of foreign key relations

Jump to solution

Hello everyone,

I'm wondering how to get the value(s) of foreign key relations when querying a table row. Using the #row object, the results I get are in entity format:

de.espirit.or.impl.EntityImpl@7781c783{f_companies,PERSISTENT,released,fs_id=791,fs_valid_from=1321381679534,fs_valid_to=9223372036854775807,fs_release_to=9223372036854775807}

Using the .length() function as in $CMS_VALUE(#row.f_companiesList.length)$, I can also recover the number of relations found. What I'm missing is how to get textual value of such relations.

Thanks fro any help you can provide!

Peter

0 Kudos
1 Solution

Accepted Solutions
broszeit
I'm new here

Hello Peter,

you can access any value of the company table using this syntax:

#row.f_companiesList.COLUMNNAME

If you have a 1:n oder m:n relationship you can access every single value with the following code

For example the company list: (with a column "Name" in the table "Companies")

$CMS_FOR(company, #row.f_companiesList)$

     $CMS_VALUE(company.Name)$

$CMS_END_FOR$

Rouven

View solution in original post

0 Kudos
2 Replies
broszeit
I'm new here

Hello Peter,

you can access any value of the company table using this syntax:

#row.f_companiesList.COLUMNNAME

If you have a 1:n oder m:n relationship you can access every single value with the following code

For example the company list: (with a column "Name" in the table "Companies")

$CMS_FOR(company, #row.f_companiesList)$

     $CMS_VALUE(company.Name)$

$CMS_END_FOR$

Rouven

0 Kudos

Hello Rouven,

Thank you!

It works as explained.

Peter

0 Kudos