Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

validate all line items are from the same supplier?


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

Recommended Posts

Posted

Hi All,

I guess I'm just rusty from not doing this for a while, but I'm trying to figure out how to do what should be a fairly simple validation. I have a table structure as follows:

Purchase Order -> Line Items -> Products -> Suppliers

There can only be one supplier per PO, and by selecting that supplier, the supplier info area filters a selection portal to only show items for that supplier. That selection portal is then used to populate the line items.

The problem arises if the user changes the supplier after there are already line items in the order. I could easily validate against changing the supplier ID field if there are existing related records in the line items table, but what I want to to is validate that there are no related line items having a different supplier than the currently selected supplier in the PO record. I guess I could do this by having a lookup field that pulls the supplier ID into the actual line items table and using a multi-predicate relationship to test that, but is there a way to do it without resorting to lookups or auto-enter calcs?

I've attached a file that shows what I'm trying to do.

Thanks,

Dana

Purchase_Orders_Copy.zip

Posted

Thanks! That worked great. The only hitch is that it doesn't seem to refresh under certain circumstances (like if you delete the offending line item) But scripting the delete and adding a refresh window (flush cached join) fixes the refresh issue.

Thanks again,

Dana

Posted

No, validation was what I was going for... What I meant was the cached results cause the validation to trigger incorrectly after deleting a line item that doesn't match the supplier. I fixed this by adding the refresh window (flush cached join) in between the delete portal row and the commit steps.

Thanks again,

Dana

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