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.

Sorting Portals arghhhhh

Featured Replies

Hello everyone:

I haven't been able to sort a portal using 2 different factors (date and person).The sort that is set when establishing the relationship, does not discriminate the person, only the date. I would like to be able to sort and obtain the 6 more recent dates of one person and paste that data in 6 fields.

I included 2 sample files that better explain what I want to do.

I really appreciate any help you can give me

Sincerely

Pablomac

pablomac.zip

You are not looking for a sort, but a filter.

create a g_name (global) in Portal layout

create a relationship from portal to Master based on g_name::name.

Change your portal using this relationship. Remove the name from the portal. Do remember to change each fields from portal using the new relationship.

Bring to the Portal layout the g_name.

Format this field to be a list from the values of Master. Choose Names from this file.

Et voila...

You now have a filter that will show you each information for a given person.

Here is your modified file.

  • Author

Thank you so much for your help, now the sorting of the portals is working perfectly but I found another issue.

In the files I attach you see there is a script that copies from the portal and pastes the value in 6 different fields. If the portal has six values works fine but when the portal has for instance 2 values (with john), then the script fills the remaining 4 values with the last value of the portal ??????

Thank you again for any help

Pablomac

Ok Pablo, you've just reached the limitation of the Copy/Paste function.

What your script is doing is

go to next row in portal

Copy from Main file

go to field1 in File A

Paste

go to next row in portal

Copy from Main file

go to field2 in File A

Paste

What it does is when there is "nothing" to copy (because you've reached the last record from the Main), it copies the content of the clipboard.

Besides, use the Go to next row function (end after last). If you had put a pause in your script, you would have noticed that it stays to the last value.smirk.gif

If you were using the Setfield function instead, if there is no record, it would set the field to nothing.

Go to next row (end after last)

Set field Field1,Filter for portal::Yes

Go to next row (end after last)

Set field Field 2, Filter for portal::Yes

Try to forget about Copy/Paste

  • Author

Well, I don't know what happened but still does not work. It does exactly the same thing. When I have less than 6 records, it continues copying the last one.

I have three different codes to perform what I want.

Note: previous to these scripts, there is another script the "zeroes' all the variables from 1 to 6.

1) Go to portal row (No dialog, By number (1))

If S="All"

Set Field ["Variable1","g_ptaname::Total BH W")

End if

If S="First"

Set Field ["Variable1","g_ptaname::Total BHW_ONE")

End if

Go to portal row (No dialog, By number (2))

If S="All"

Set Field ["Variable2","g_ptaname::Total BH W")

End if

If S="First"

Set Field ["Variable2","g_ptaname::Total BHW_ONE")

End if

and so on for the remaining variables 3,4,5,6.

2)

If S="All"

Go to portal row (No dialog, By number (1))

Copy [select,"g_ptaname::Total BH W")

Paste [select, "Variable1"

If S="First"

Go to portal row (No dialog, By number (1))

Copy [select,"g_ptaname::Total BH W ONE")

Paste [select, "Variable1"

and so on for the remaining variables 3,4,5,6.

3) If [s="All"

Go to portalrow (Select, By number (1)

Set field ["Variable1","g_ptaname::Total BH W"]

End if

If [s="First"

Go to portalrow (Select, Exit after last, Next)

Set field ["Variable1","g_ptaname::Total BHW ONE"]

End if

None of them work. It when there are less than 6 records, for example 2, the variable3 to variable6 are filled with the same value as variable 2.

Any ideas would be greatly appreciated

Pablomac

  • Author

Sorry, I found the problem. I had not updated the code in my application with the one I posted here and there were some differences!!!

Now it is working!!

Thanks a lot

Pablomac

Create an account or sign in to comment

Important Information

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

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.