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

New related records within a portal


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

Recommended Posts

Posted

Hello all,

I've been wrestling with a problem I have with the generation of a new record within a portal. I use a script to show the related records within the portal, and if there are no related records present, the script creates a new record and presents me with what seems to be an empty portal awaiting my new record. The catch is that after I've input my data (or even if I don't input any data), and click outside the portal I always get one blank related record appearing at the top. I've tried go to first record, portal row, and can't seem to cause a new related record to be created without getting the bonus blank record. Can anyone shed some light on this? crazy.gif

Thanks for your help, Peter

Posted

I don't understand why you need a script to show related records in a portal. A portal does that all by itself. Futher I don't understand why you want to a script to create a new related record just because there isn't any. I use scripts to create new related records, but only when I need one.

You need to look at the relationship to see if it is set to allow creation of related records. Is there some sorting being done either in the relationship or in the portal?

Give us some more info to work on.

Posted

Just to ask a starting-point question from another angle: you've (1) enabled the "Allow creation of related records" option when you defined your relationship, and you've (2) tried just going ahead and (without a script) typing *directly into* the first blank portal row in order to create the related record? And what happens when you do that? Do you need to do more than that?

If you type into a blank portal (provided the relationship is defined to allow it), that's all you should need to do to create related record... Are we missing something about your situation here?

Posted

Here's the deal, I have three tables,each related to the other with a match field "Category". The first table, Categories, consists of two fields:

"Category" and

"Constant".

I relate this table to it's self via the constant and place a portal on layout to provide a convenient list. This list is used as the basis for the relationship in the two other tables.

My second table is "Components" which has four fields:

"Category",

"Component",

"gCategory_Selection" &

"gVariables"

A portal is placed on this layout with another self-join relationship to show a list of related values using "Category" as the match field. "Component" is placed in the portal. The field "Category" is placed on the layout and set to not allow entry. "Category_Selection" is placed directly beneath and set as a pop up menu with values derived from the "Category" field in the Categories table.

Choosing a category from the "Category_Selection" field and clicking an adjacent button performs a script that enters find mode and pastes the "Category_Selection" into the category field, returning the related values. When I go to the components layout and want to create a new record (based on a "Category" as selected on the main layout) I choose a category as indicated above, all is well with the exception of the "extra" record that is generated within the portal.

The third table: Lets not go there for now.

I hope this makes sense (hhmmmmm) but the overall objective here is to enable the user to generate dynamic lists that are related to one another enabling the filtered information to be used elsewhere in the solution.

If you've any other approach, I'd love to hear it.

Thanks for looking and helping,

Peter tongue.gif

Posted

I have built a set of tables similar to what you described. I do not have your blank portal row problem. I did a GTRR rather than a find. I am attaching the file.

Posted

Ralph,

Thank you again for your interest and help with this.

I finally had a chance to go through your solution to find that the "commit records" step was the one I left out and was giving me all the trouble. I changed my script to include this step and all worked fine. I've never used this step before, do you have any info on how and where this should be used?

Keep up the good work,

Peter yay.gifyay.gif

Posted

Commit Records is similar to the Exit Record/Request step available in previous versions. It is more vital, however, in version 7, because a record won't update without it even if you don't have the cursor in a field before running a script. It is also essential to use when setting a field that is used for a relationship that you want to reference elsewhere in a script.

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