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

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

Recommended Posts

Posted

I have a database that we use to track ip addresses for computer systems we sell. I would like users of the database to be able to select the serial number of any system in the database from a pop-up list. This pop-up list would be a global input field that pulls the serial numbers from a serial number field in the database. Once a serial number is selected in the input field, the user would click a find button and the selected serial number and related related records would be found and displayed in another layout. If a serial number was enterd into the pop-up list field that wasnt in the database, the user would be asked if he/she would like to create that record. Can someone give me a few pointers to make this happen?

Any help is greatly appreciated.

Posted

Search in help for "Set Error Capture script step". Right after the point they have - Show Custom Dialog ["Couldn't find the record..."] - put your script steps to create a new record if user clicks the Yes button.

Posted

sbg2,

Thanks for the input, I think I see where you are going, but Im still not clear on the search part. After looking at the Set Error Capture script - here is what I understand:

1. Error capture is turned on.

2. A find is performed (I'm not sure how to use the specify find request part of the find function.) I have a field titled input_serialNumber that the user chooses from a drop down list. I need to use this input to find data in a serialNumber field. Can you explain?

3. It looks like I need to create a global field titled ErrorCaptureField - Looks like this field is used to determine if a search is successful or has errors??

4. I added a new script part that adds a new record based on the input field if I get an error.

thanks for you help.

-vfranklin

Posted

The way I see it you need one table and two layouts.

First the layout (IP Details) you input all the detailed information for each IP address ( name, type of computer, OS, date sold etc..).

Then a layout (Relate IPs) that has the global pop-up list based on the IP field contents.

Create a self join relationship using the IP address field = IP Global Field and call it IP Sort.

Place a portal on the Related IPs layout and link it to IP Sort.

When the user selects a IP from the pop-up list all related records will appear in the portal.

You could then use go to related record to display the ip record details.

If the user is allowed to type in an IP address into the global field and it does not exist. Then no records would appear in the portal. I would add a line of text that says "If no records are shown check the IP entered or click add." Add would be a button that would create a new record based on the unfound IP address.

Does that sound like what you wnat to do? Or am I off base?

Posted

Quillpro, thanks for the input. Your solution will work, but I would like it to be a little more automated. I actually had something that I liked working in FMP5.5 that uses a lot of the ideas you have shared.

I had self-joined relation set up between input_serialnumber and serialnumber and I had a portal setup like you have suggested, except I had it on another layout.

I had a login layout that only had the input_serialnumber field on it and it was a drop-down list (incase a serial number wasn't in the database a user could enter it on his/her own).

On this layout, I had an "Enter" button that when clicked would run a script that would go to the layout with the portal, check to see if anything was in it.

If something was in the portal, the script would perform a find, and then go to my details layout that showed all the related information.

If the portal was empty, the script would display the message "The serial number you entered does not exist.....would you like to add this serial number.

Based on their choice, the user could then either create a new record, or exit the script by selecting cancel.

This worked great in 5.5 but I cant seem to get it to work in 7. Here is what the script looked like:

Any ideas how to get this functionality working again? or is there a simpler method? Like Sbg2's idea?

Go to Layout [ RecordLookup ]

Go to Portal Row [ First, Select entire contents ]

If [ IsEmpty(Status(CurrentPortalRow)) ] Show Message [ Buttons:

Posted

A couple of thing in your script have change in FM7.

"Show Message" is now "Show Custom Dialogue"

"Status(CurrentMessageChoice)" is now "Get(CurrentMessageChoice)"

That a couple, mostly the others is punctuaction. If you recreate it in 7, it should functions like it did in 5.5.

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