Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Problems adding new records in portals


This topic is 6699 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!!!

Posted

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.

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

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

  • 1 year later...
Posted

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.

This topic is 6699 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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