Jump to content

Validation to create a related record.


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

Recommended Posts

Hello,  

Not sure if this is the correct area to ask but I've been racking my brain and am not getting anywhere.   

I have an Event table (Fire Incidents) and related to the ID of the event you can create attendance records in the attendance table for the members responding to the fire emergency.  I do the attendance adding using a portal on the event record and add the members by capturing their Personnel record ID and then setting the last row of the attendance portal using their personnel record ID and the event ID.  That has been working great and there is no issues there.   I wanted to add a new validation that looks to see if that Personnel record ID AND Event Record ID do not exist as an attendance record, before it allows the user to add the attendance.  

I'm not sure what I should show here, relationship graph, or something else to help understand what my file looks like.   Let me know if I should send any additional info.  

Thanks for everyones time,  this forum has been amazing and it's not possible without everyone.  

 

Thank you.  

Chris

Screen Shot 2018-09-09 at 7.08.37 PM.png

Link to comment
Share on other sites

Hello,

If you want to add related records with validation, you have to use script and not FILEMAKER link.

For example, you could make a script for looking at different validation return 0 if ok or 1 if false and then created the related record or not.

Not sure to be clear

Tom

 

Link to comment
Share on other sites

Hi Tom.  I do have a script that creates the new records in the related Attendance table while the user is on the Event Report layout.   It was the script step or calculation that I am unsure how to implement?  I didn't want to do a full perform find to see if there was a record already created for that firefighter at that event.  I though it cold be done more simply buy adding a simple script step in the current script.  

Thanks

Chris 

Link to comment
Share on other sites

There are quite a number of sample files out there that include 'Picker Lists'.

Some use a conditional or dwindling value lists, and others use a picker list tied to a relationship that excluded people already picked.

If I'm not mistaken, I think the FileMaker Training Series has a chapter and sample file to do this exact thing.

When I have time a little later, I'll see if I can find it.

Link to comment
Share on other sites

Thanks Steve.   I thought about how to implement a dwindling list and even started doing the work to put that in but then I realized that firefighters can also scan in by barcode which means they aren't selecting from a dropdown list.   This brought me back to the "checking to see if a record exist before proceeding" idea.   

Thanks 

Chris

Link to comment
Share on other sites

That's a great idea.   I created that field and tried it out.   What would be a good way to deal with all of the error messages that come up when a duplicate record is created.  I have a dialog box pop up when the validation fails but then a few more Revert or Cancel dialog boxes come up and then it still allows a user to ultimately create a duplicate record.  

Thanks,  Chris

 

Link to comment
Share on other sites

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