Jump to content
Server Maintenance This Week. ×

Muliple field key in relationships


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

Recommended Posts

Here is my problem. I want to display only the current school year information from a related file.

My key field is defined as a calculation "schoolID&Year" this is the same in both the main file and the related file. Now I've tempararyly added a field to the record view that has the current year value. I'm planning on making it a global/preference type of field. When I change the current year field my portals display the related records for the correct year. Now I was thinking I would like the user to be able to update/create records in the related file as necessary. (The related file contains the dates as to when the school has submitted paperwork as required by the grants that we are administrating.) When I go to type in the field in the portal I get the "The relationship 'Documents' is not valid and must me corrected before this field can be modified" This is true since the related document hasn't been created yet and the the schoolID and year fields would not have a value yet.

My question is what is the recommended way to great around this problem?

I suppose that I could have the user go to the related field and enter data directly there. But I had hopes that I could work form the main database using portals.

Paul

Version: v6.x

Platform: Mac OS X Panther

Link to comment
Share on other sites

Create a script in the related file that creates a new record and sets the fields as needed. In the main file, put a "New" button next to your portal that calls the external script and puts you in the appropriate field/row of the portal.

Link to comment
Share on other sites

I've done that before. I was just hoping that there was a way that I could make the change directly in the portal view. It would work better in the solution I am designing to be able to just type in the portal makes more sense. Thanks for the suggestion.

On second thought. I only want to create a related record is there isn't one present. My related file has dates for multiple items. There are 7 items due during a school year for the holders of the grant. What I want to happen is when the first item is received I want to create the record and then for the remander of the items just add the date received in the appropriate date field. I was think that I could have a script that I run at the beginning of the year to create a record for each school and then the records would already be there. But that solution seems kluggy to me. I suppose that I could have the create new record script only create a record is there isn't already one there instead of always creating a new record.

Link to comment
Share on other sites

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