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.

Filtered/dual purpose portal

Featured Replies

Hello

I have 2 portals on a tabbed layout based on a self-join between a table of booking records.

The first tab displays sub-sets of bookings according to Payment_Method "filtered" by a selection in a global field outside the portal. One Payment_Method is "credit card".

On the second tab I want to display records where Payment_Method="credit card" and where another field CCAuthCode=0.

Is there a way of doing this without creating another TO of the booking records.

Thanks

Paul

I think you'll need a new TO because you need a new relationship that includes a match on CCAuthCode. When you say it =0, do you mean empty? Since you can't build a relationship matching on empty, I'd create a flag field, flag_NeedsAuthCode = if ( isempty ( CCAuthCode); 1; 0). Then match a constant1 to this flag field as the second match in the relationship.

  • Author

I am trying to avoid another TO because the fields displayed on the portal from the booking records include :B:Name fields from Company & Contact tables that also have to be duplicated if I recreate the Bookings table.

Since originally posting I did come up with the following. An additional calculated join field that takes the value of either CCAuth or "0" depending on which tab in the layout is at the front. The problem now is I don't know how to identify the front tab.

It would help if you explained what the CCAuthCode field means and what values can it contain - and esp. whether it can be empty.

  • Author

The CCAuthCode field is used to store a value for credit card authorisation. The field cannot be empty.

I want the second portal to display all records with Payment_Method="Credit Card" & CCAuthCode=0.

The CCAuthCode field is used to store a value for credit card authorisation. The field cannot be empty.

That still doesn't tell me which values it CAN contain, other than 0. In any case, you can do this with a single relationship (which also means a second portal is not really required). If you define a calculation field cAuthCode (result is Text) =

CCAuthCode & ¶ & "All"

and change the relationship to:

Bookings::gPaymentMethod = Bookings 2::PaymentMethod

AND

Bookings::gAuthCode = Bookings 2::cAuthCode

as long gPaymentMethod contains the value "credit card" and "gAuthCode" contains the value "All", the portal will show all bookings whose PaymentMethod is "credit card"; enter "0" into gAuthCode, and the portal will show only those whose CCAuthCode is 0.

If you like, you can toggle between "All" and "0" using buttons that simulate tabs.

  • Author

Apologies, ccAuthCode contains numeric values representing the actual authorisation code given by a credit card company when processing a payment.

You solution worked a treat thanks.

Rather than manually toggling the All/0 global I was able to use

Case

(

GetLayoutObjectAttribute ( "InvTab" ; "isFrontTabPanel" ) ;"All" ;

GetLayoutObjectAttribute ( "CCTab" ; "isFrontTabPanel" );"0";

)

Do need 2 tabs/portals as they each display different fields.

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.