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

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

Recommended Posts

Posted

I have a relational database where there are:

1. A parts inventory database

2. A vehicles inventory database

3. an Invoices database

4. A Line Items database,

among others. On the invoice (within a portal creating new records in the Line Items database), my user will enter a number in the "Quantity" field. I need to validate this quantity based on several parameters, and generate various error messages depending on the parameters violated. Since both Parts and Vehicles may be ordered on the same invoice, we first have to determine upon entry whether "Quantity" is to be subtracted from the Parts Inventory or the Vehicles Inventory, then make further validations based on that determination. So. Here are the parameters I want to check upon entry into the "Quantity" field within Line Items:

1. Numeric data only, if not, generate message "Numeric data only."

2. Is a number is entered in the "Part No." field (Indicating that this line item will be a Parts order)? If Yes, check the Parts Inventory database for the amount in stock. If the number being entered in "Quantity" in the Invoice (Line Items) exceeds the number of parts in stock, generate message "Out of stock." Alternatively, if the number entered would bring the number in stock below the number in "Re-order Point," generate message "Time to re-order this part number." If no number was entered in the parts Number field, then:

2. Is a number entered in the "Vehicle ID" field? (Indicating this line item will be for a vehicle)? Check the Vehicles database record for this vehicle; if the Sale Flag field reads "SOLD", then generate message "This vehicle has already been sold."

I have been unable to figure out a way to display a such range of eror messages based upon the validation resources available in Filemaker Pro. I am sure it can be done. Perhaps with a script? Can entry into a field trigger a script? Help!

Posted

What you need to do is use the portal for display of the line items, but don't allow record creation by entry into the portal. Create a set of global fields on the same layout and use these for data entry. After the user enters data into the global fields and hits an "enter" button, perform whatever esoteric validation you require, if the entries pass, creat a new record in the line items file (under script control), copy the global values to the new record, and clear the globals.

-bd

Posted

This sounds like a great plan, but is there some reason why the temporary entry fields have to be globals? Seems like I could accomplish the same thing in a script using standard fields, which have more sophisticated validation tools, then zero them out at the end of the script. I'll bet there's a very good reason, but before I write the script i just wanted to check.

By the way, your service here is absolutely wonderful. Just want you to know I appreciate it very much.

Posted

You use the global fields simply so that you do not actually need to create records until you KNOW that the data is correct, or at least passes all validation.

Otherwise you get serial numbers and such updating for records that are not necessarily correct, or records which are partially filled in, or should have been deleted, etc.

When in a situation that uses heavy validation it is just easier to create the record after all validation issues are satisfied, the user does not notice any difference however.

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