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.
Juggernaut

Setting fields in related database

Featured Replies

This is driving me crazy. I have button in a portal that is supposed to set fields in a related database. I use the relationship "open cases relationship" for the portal. The relationship matches "name" in this database with "namestatuscombo" in the related record.

The button is supposed to change namestatuscombo and two other fields in the related database.

"namestatuscombo", in the related record, starts out containing the person's name.

My script reads

Set Field ["open cases relationship::namestatuscombo",""closed""]

Set Field ["open cases relationship::completed",""yes""]

Set Field ["open cases relationship::date completed", "Today"]

By changing namestatuscombo to "closed" the related record no longer matches the "open cases relationship" and so it no longer appears in the portal.

It seems to work about half the time. The other half, only the field "completed" gets updated to "yes". This doesn't make any sense to me.

First of all, you can't break the relationship and then expect to change fields in a now non-related record (duh!). If changing namestatuscombo breaks the relationship, why not move it to make it the last set field statement rather than the first?

The fact that it works in an unpredictable manner is probably related to how and when the related record set is refreshed by FM.

-bd

  • Author

Oops, I typed the script steps backwards. Setting namestatuscombo comes last.

Also I should have said that the script works completely the way it should about half the time (all fields get updated).

In every case, "completed" gets changed to "yes", but a lot of the time this is the only field to get updated.

Try putting an "Exit Record/Request" step before the last Set Field step and see what happens.

Like this:

Set Field ["open cases relationship::completed",""yes""]

Set Field ["open cases relationship::date completed", "Today"]

Exit Record/Request

Set Field ["open cases relationship::namestatuscombo",""closed""]

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.