List Of function do not exist i FileMaker Pro 12. All things you create that exist in later version that you are using will create problems for you. Try to update your user to at least run FMP13 if that what you are developing in, but even better if you all can use the solution in FMP15.
The way I think about is that you can Loop your records and create a list with the information that you want.
You'll have to do it the way Johan suggests. Script the gathering of the id's, put them into your global field.
Go to Record/Request/Page [First]
#Initialize global serial field
Set Field [Table::YourGlobalField; ""]
#Set primary keys to a local variable with append technique-faster than looping thru a global field or global variable
Set Variable [$id; Value: $id & "¶" & Table::YourGlobalField]
Go to Record/Request/Page [Next; Exit after last]
#Remove starting pilcrow and blank record created by first pass thru loop
Set Field [Table::YourGlobalField; LeftWords($id;999999999999)]
Close Window [Current Window]
//do what ever else you need to do
A relationship or unstored ExecuteSQL function could also return such a list. Both, especially the latter, might be slow to update with large numbers of records.
Using a cartesian self join,
List ( relatedtable::Field )
Will list all values of Field.
ExecuteSQL ( "Field FROM Table" ; "" ; ¶ )
Would do the same with ESQL.
List Of (as summary) works on a "found set" of records. So keep that in mind.
I did forget that "found set" based difference in results. That might not be insurmountable if you can replicate the "find" that produced the found set in the SQL expression's WHERE clause, but it's definitely a major detail that I overlooked.
The old "hoary" method is to change to a layout based on the same table occurrence but with only that single field on it and then use "copy all records" to get the return separated list. That works, but requires using a version of Copy followed by "paste" to get the desired result--with a number of potentially negative consequences for your solution design and user experience.
Thank you very much developers
Actually I used the "List of" option of summary datatype for my Products table where I displayed its layout in form view and inserted its own portal to show all records in a list. When I click a portal record, it shows that record in detail on the product form beside. The field "List Of ID" have relation to second occurrence of Product table in relationship window to the ID as one to many. It works great and very simple solution as compared to all other solution I found. But for FM12, as I mentioned earlier can be done manually and it works also.
Now for this situation if you could suggest a function might be more easy and simple.
How many users are on your system? If it's a small number of users then you'll probably find that the amount of time you spend trying to work around this issue costs you more than the upgrade would.
I do understand that not everyone can upgrade, for a wide variety of reasons, but you should take the value of your time into account when considering it.
...Now for this situation if you could suggest a function might be more easy and simple.
I did give you a simple solution in my first post. Use that global field for the basis of the relationship.
As well as the combined value of OUR time.
Really; upgrade already. Don't waste any more of anybody's time on this.
If you want duplicate values in your list, the following won't work. But, if you want unique values, you can create a Value List based on your relationship and utilize the ValueListItems function.
OLD SCHOOL: loop the found set of records and push the value(s) as needed to $variable(s) (or even older, to global field)
It can be done.