Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6038 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

If this isn't a trick question, of course you can.

Have you tried it?

Edited by Guest
Posted

If this isn't a trick question, of course you can.

Have you tried it?

Sorry, maybe I have to change my question.

Is it possible to display all the portal rows in a <> or text field?

Posted

Try creating a calc on the parent side of List ( PortalRelationship::yourField ) then use that as a merge field.

  • 2 weeks later...
Posted

Try creating a calc on the parent side of List ( PortalRelationship::yourField ) then use that as a merge field.

I was trying the suggestion but I run into problems maybe because the "Product" field I like to display from the portal comes from a third table.

Table 1

Portal with "Product Field"

----Links to----

Table 2

Records from Portal incl. a relation field "Product" from Table 3

----Links to----

Table 3

All records on available "Products"

So you think this is my problem? If so how can I get the portal "products" into a merge field?

Thanks

Posted

List ( Table2::ProductID ) will return all the product IDs.

Create a new Table Occurrence to Table 3 keyed from the calc field to the ProductID field in table 3.

List ( [color:green]Table3 2 ;):Product Description) in a new calc will return all the descriptions.

Posted

List ( Table2::ProductID ) will return all the product IDs.

Create a new Table Occurrence to Table 3 keyed from the calc field to the ProductID field in table 3.

List ( [color:green]Table3 2 ;):Product Description) in a new calc will return all the descriptions.

Cool got it to work thanks for the guides.

Here is the problem though, I did not think about it ether so I did not mention it. On Table one, in the portal I have the oils, that list fine, but I also have a field from table to that displays weight. So how can I create the calculation that lists the oil and the weight of the oil too?

How can this work?

Thanks

Posted

List ( Table3 2 ;):Product Description) & " - " & List ( Table3 2 ::Product Weight) ??

Posted (edited)

Wouldn't this produce a list of products THEN the list of weights? I admit to being lazy (just woke up) so I haven't put much deep thought into this response. But I would think, from products table, a concatenated calc of Product Name & " - " & ProductWeight might be what is wanted? :wink2:

UPDATE: Oh, then of course from parent use as John suggested: List ( Products ; thisCalc )

Edited by Guest
Posted

A custom function along the lines of the one here:

http://www.fmforums.com/forum/showpost.php?post/267809/

might be useful here, to eliminate the need for the interim calculation.

Posted (edited)

Yes if you want it to return to return side by side a concat field would be used. I wasnt understanding what he wanted hence the '??'.

He stated that he wanted a list of all the oils and then weights in one list, so I seperated the two lists with a hypen seperator. You are probably right though in what he was looking for.

* Edit - after re-reading it, I dont know how I misinterpreted it. A little slow I guess. :crazy:

Edited by Guest
added PS
Posted

Hi,

Even without any concanated field, you may use the CustomList CF

http://www.briandunning.com/cf/747

CustomList ( Start ; End ; GetNthRecord ( FirstField ; [n] ) & GetNthRecord ( SecondField ; [n] )" )

or better using named objects fro your fields, and then respecting your *portal sort order*

CustomList ( Start ; End ; "GetLayoutObjectAttribute ( ""ObjectName1"" ; ""Content"" ; 1 ; [n] ) & GetLayoutObjectAttribute ( ""ObjectName2"" ; ""Content"" ; 1 ; [n] )" )

Start and End may be calculated values, ex Start = 1 and End = Count ( relation::ID )

Posted

Even without any concanated field, you may use the CustomList CF

You probably missed Michael's suggestion of eliminating the interim calculation using his CF? :wink2:

Posted (edited)

No, I don't think so.

- First because GetNthRecord ( ) is sensible to the sort defined in the Define Relationship dialog, thus not following the portal sort order in this case ( if needed ).

- Second because this is a concanation of all of one field's values in the related set, or I missed it.

Any lights appreciated here. What am I reading ?

PS ;) ok, Michael was saying "along the lines" so may be he was thinking of doing the concatanation through the recursion.

Edited by Guest
See PS
Posted

this is a concanation of all of one field's values in the related set

That's why I said "along the lines of". I thought the required adaption was pretty obvious:

ListSet2 ( fieldName1 ; fieldName2 ; startRecord ; endRecord )

Let ( [

item = GetNthRecord ( fieldName1 ; startRecord ) & " - " & GetNthRecord ( fieldName2 ; startRecord )

] ;

Case ( not IsEmpty ( item ) ; item & ¶ )

&

Case ( endRecord > startRecord ; ListSet2 ( fieldName1 ; fieldName2 ; startRecord + 1 ; endRecord ) )

)

GetNthRecord ( ) is sensible to the sort defined in the Define Relationship dialog, thus not following the portal sort order in this case ( if needed ).

I would wait until the 'needed' part is clear before suggesting a sort by custom function. These things are slow.

Posted

Yep, that's what I understood afterwards.

About the sort, if it's based upon the portal sort order, using objects rather than fields, it's not that long. And CustomList is not recursive.

That's why I suggested it.

Posted

Any sort other than Filemaker's native sort is slow. CustomList is not recursive, but I am not at all sure it makes a significant difference.

Regarding using objects instead of fields, and following the portal rows: it's a neat idea, but it needs to be pointed out that the calculation is tied to the layout objects and depends on their existence.

  • 1 month later...
Posted (edited)

Hello, so I created a Custom Function with the provided script. The newbie question of today: What should I put for startRecord and endRecord?

My current calculation is:

ListSet2 ( oil_quantities::oil_name ; oil_quantities::oil_weight ; startRecord ; endRecord )

Thanks

Edited by Guest
Posted

Try:

ListSet2 ( oil_quantities::oil_name ; oil_quantities::oil_weight ; 1 ; Count ( oil_quantities::YourMatchfield ) )

Thanks comment

So I try to understand what are StartRecords or in this case now "1" and end record, now "oil_quantities::YourMatchfield" stand for?

Is it the record count, how many records are in the database?

quantities::oil_name = Oil Name

oil_quantities::oil_weight = Oil Weight

1 = increment of one?

YourMatchfield = ?

Posted

If you want the function to get data from ALL related records, you need to tell it to start at the first record, and end at the last one. So the startRecord parameter is 1 (the number one), and the endRecord parameter is the count of related records (or found records, if you're working with local fields).

To count related records, you count any field that cannot be empty. The matchfield used for the relationship is one such field.

Posted (edited)

Understand, thanks comment!

I would also assume just to add additional fields to the function in order to show units or such. Right?

Confirmed!

Is there a way of formating the result better?

At this time it looks like this

Coconut - 340 - 373.33

Palm Oil - 170 - 186.68

but I wanted to add a unit field and some tabs to make it read better.

Coconut - 340g - 373.33g

Palm Oil - 170g - 186.68g

Edited by Guest

This topic is 6038 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.