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

New portal row w/o "allow create of related rec"?


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

Recommended Posts

Posted

My portal rows each contain a small Delete button. Aesthetically I can't stand seeing a Delete button on that last, empty row that exists because of "Allow creation of related records". However, since I do need to create records in the portal, I'm trying to find a way around the "Allow creation of related records" option for the portal.

My best effort so far has been to store the value for the related field into a global, and call a script in the related file to create a new record and fill in the related field. Back in the main script, I then GotoPortalRow[select,Last] and fill in the remaining fields.

A new, blank record does appear in the portal, but GotoPortalRow[select,Last] usually selects the 2nd-to-last row instead of the last one, which is the new record. I say "usually" -- I'm pretty sure I've seen it select the last row on occasion, but I'm not sure of the circumstances.

Am I on the right track, or is there an entirely simpler way to do this?

Thanks,

Chap

Posted

Sounds like a solid plan to me. I'm a bit quirky on things like pointless display elements too so I understand the asthetic desire to clean it up. But, my laziness usually wins out of the desire to make it perfect.

I personally hate hopping between databases (v6) or tables (v7) to get things done. It's easier in v7 but still a similar process. One thing I have done in the past is to create two identical relationships, one with Allow Create and one without it. Then, I have added a REALLY tiny, transparent portal (for the Allow Create relationship) with just one of the related fields in it on the same layout as the main, read-only portal. Then you can use a process of having a local global or two to get the data and then script the slamming of that data into the Create Allowed portal (which can't be seen by the user) which then will also show up in the main portal.

Having explained that process, I'm sure some other FM folks are cringing but, eh, it works for me.

I have also put those tiny, transparent portals behind other solid objects so that the user will never be able to accidentally find them with an errant click.

Posted

My best effort so far has been to store the value for the related field into a global, and call a script in the related file to create a new record and fill in the related field. Back in the main script, I then GotoPortalRow[select,Last] and fill in the remaining fields.

A new, blank record does appear in the portal, but GotoPortalRow[select,Last] usually selects the 2nd-to-last row instead of the last one, which is the new record. I say "usually" -- I'm pretty sure I've seen it select the last row on occasion, but I'm not sure of the circumstances.

This is the way I have been doing it and the cursor is always in the last row. You might want to add a step before going to last row. Go to the first field in the portal row that the user must enter data then go to the last row.

Posted

Copy your button in Layout Mode and paste it into a global container in the related file in Browse Mode, then put the related global field in your portal. It will only display when there is a related record so you can keep 'Allow creation of related records' selected.

Posted

....don't know for sure...but something I am trying to achieve sounds a bit related....?? have layout in a file with multiple fields to display data from the same field in a related file....only each field in the first file, has to relate to a different record in the related file.....this actually applies to a couple of fields....BUT i need to display the fields one on top of the other, which portals dont seem to do?....any wisdom on this subject gratefully recieved, and hope its useful question for some other users too...

This topic is 7349 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.