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.

GTRR and New Record question

Featured Replies

Hi to the community.

I've searched the forum and have been unable to find a working solution to my question.

I'm certain I'm missing something simple.

I have 2 tables, "Items" and "Details"

The relationship is set up with allow creation

checked on in details. Primary key in "items" is linked with and matches foreign key in "details".

Two issues to resolve.

First, I'm unable to get my "go to related records" script step to work. The foreign key

field in "details" isn't populating.


if[isEmpty(details::kp_id_details)]

 Go to Layout ["details"(details)]

 New Record/Request

Else

 Go to Related Record [show only related  records; From table: "details"; Using layout: "details"(details)]

End if




The second issue is the button in details layout

which creates a new record. It doesn't insert the

the foreign key for the current parent record.

It seems to lose "scope". 





Set Variable [$ID; Value:details::kf_id_items

Set Field [details::kf_id_items;$ID]

I've attached a small sample.

Thanks in advance for any help.

newRec.fp7.zip

Edited by Guest

Set Variable [$ID; Value:details::kf_id_items

You are assigning the wrong value to $ID.

$ID must be set to the PRIMARY KEY from ITEMS and you are missing the switch to valid layout based on DETAILS - everything else looks fine.

Incidentally, if there are no records in the current found set then your button should stop before attempting to create a related record.

Did you think you could create related records on the primary layout? If you want to do that then you must have a portal to display the related records and use the portal to build your related records, but you do not need to pass $ID through on this one because FM knows the relationship and will automatically set the foreign key.

Edited by Guest

  • Author

Thank you. That works perfectly.

Portal suggestion made the GTRR work as expected.

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.