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.

how to select portal with script?

Featured Replies

I have a script to add court charges to a portal, but I must first click into a field in the new portal record, then the script adds the info. It works great but how can I get the script to select the portal by itself? There are a total of three portals on the page. Thanks.

To "select a portal" you really mean "go to a field in the portal." Tell FileMaker to go to a field in the portal; which tells it which relationship to use. Then go to the Portal Row you want (otherwise FileMaker just goes the first row).

However, portals are primarily data entry and viewing objects for the user, for related records. If you are creating related records via script, you can alternatively create them in the related table without using the portal.

A big question here is: Since you're using a script to create related records, do you even need "[x] Allow creation of related records" turned on? In other words, do people really need to create records directly in the portal?

You could just put a "New Whatever" button above (or next to) the portal, to create the related record, and put them into the desired row and field.

A secondary, less important question: Do you want to Sort the portal?

  • Author

.

Edited by Guest

  • Author

I have re-read your post. So I actually don't need to have a portal that allows creation of records, when I could program a button in my main screen to create a record in the related table (my charges table), as I understand, the portal then would update automatically with the new info. I like this idea better, assuming I understand you fully. My current scripts are very simple. Simplified, I have this for my tables

MAIN TABLE........................CHARGES to CLENT TABLE

client_id_key........................charge_key

client_name.........................client_charged

address...............................charge_amount

calc_field_balance................type_of_charge

fkey_charge

If the button is on the layout for the MAIN TABLE, what do I need in my script to get it to add records to an entirely different table, CHARGES TABLE? I can program the data entry, but how to put it in that other table? And would I pass the client_id_key or name to the other table, and how?

Edited by Guest

And would I pass the client_id_key or name to the other table, and how

Yes, via a $variable, since you're on fm9! You can place it as autoenter value in the foreignKeyfield, so all you need is:

Go To Layout (child)

New Record

Go To Layout (original)

--sd

  • Author

Could your answer be more explicit please? I am new to writing scripts. Could you write a short example of how the variable gets its value and puts it into a field? Tak for lån.

Try to inspect this template!

http://fmforums.com/forum/attachment.php?attid/12108/

...although it uses the scriptparamter instead is it in principle the same, just initiate the script with the setting of an $variable:

http://www.filemaker.com/help/Script-Steps15.html

--sd

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.