Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Portal Display

Featured Replies

Is there any way to display portal fields in a <> text or a text field?

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

Have you tried it?

Edited by Guest

  • Author

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?

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

  • 2 weeks later...
  • Author

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

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.

  • Author

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

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

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

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.

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

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 )

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:

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

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.

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.

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...
  • Author

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

Try:

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

  • Author

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 = ?

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.

  • Author

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

You can shape the returned rows to anything you want - by modifying the definition of 'item' in the function.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.