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.

Problems adding new records in portals

Featured Replies

I'm having trouble figuring the frustratingly simple action of add new records into a portal (without adding records in the main table).

A portal I created is designed to record sales contact histories for each client. I placed a "New" button inside the portal and at first it created new records in that portal just fine. While testing, I created 3 records inside it.

Later I mistakenly deleted the "New" button, then realized I still needed it, I put it back inside the portal again. As before, its script created a new record. But now the new record is in the main table. Meanwhile I am stuck with just 3 history records inside my portal, even though the portal has 5 rows and a scroll bar.

The portal is referencing a table that just has 4 fields: A date & notes field, an ID field (used to relate to the main table) and a NameID that is autoenter serial. There's a many-to-one relationship between this table and the main table. The portal contains only the date and notes fields.

Help! I can't figure out what I'm doing wrong!!! hairout.gif!!!

  • Author

Problem solved. I removed the "New" button from the portal and added the ID field that relates to the main table.

Now it works perfectly.

Why that fixed it is a complete mystery to me.

If you create a new record, you first have to move to the TO the related records live in or else you are creating a new record in the current table. It is usually easiest, though, to set the relationship to allow creation of related records in the child table, then just type into the blank row at the bottom of the portal to create new related records.

I have used the add new records into a portal many times before but I have hit a snag in 7 that I cannot fathom.

When I click outside of the portal after having entered new data into the bottom line I am getting a message to the effect that ' this action is not possible as this field is not modifiable' and yet it will allow me to change any of the existing records in the portal without a problem.

The portal is a self relate based on a constant. Other portals using a conventional relationship work fine

Any help would be appreciated

TIA

Phil

ps file attached if it helps - layout is stock edit

tester.zip

In the Stock Table Create Field named Field_For_Relation for which auto enter=1,

then your relation must be by constant=Field_For_Relation. If is not clear i will attach you your "Tester" file with little changes.

I have looked at your attachment and added the constant field into the portal to see what is happening. As you add a new record the constant field does not change on the portal row presumably because the record is not yet committed (I am not sure of the reason), if you change the constant field definition to an auto-enter 1 then it seems to work OK.

A portal based on a calculation field in the child table cannot create child records. Clicking in the last portal row is equivalent to:

New Record

Set Field [ Child::Key ; Parent::Key ]

When you click outside the portal, FM is trying to commit the record, but it cannot set a calculation field.

You could not do this in previous versions either.

Thank you everybody.

I guess I must never have used a self relate with constant before

Ah well.....

Phil

When you click outside the portal, FM is trying to commit the record, but it cannot set a calculation field.

But it's up to the developer to deside, which of the keyfields that forces the linking thru - It's posible to make the foreignKey an autoenter linked to the mainrecords keyfield that then has no autoenter value when created. This means that the id of the first portalrow forces the rest of the portalrows ID's into it's value.

Try to read this: http://www.databasepros.com/resources.html ...where you type the word "unnoticed" sans quotes in the box and submit the form.

--sd

Thanks Soren

Phil

  • 1 year later...

aaa and Slim,

Thankyou, thankyou, thankyou!

The auto enter constant on both ends has solved a problem I have been trying to solve for hours.

This is the only way I have ever heard of that enables you to, "allow the creation of records in this table via this relationship", from a child to a parent, via a portal, and it saves scripts and ugly windows.

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.