February 26, 200916 yr 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
February 26, 200916 yr Author 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
February 26, 200916 yr I thought you wanted to validate the SupplierID field. For a visual indicator only, it can be much simpler: ValidateSupplier2.fp7.zip
February 26, 200916 yr Author 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
Create an account or sign in to comment