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

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

Recommended Posts

Posted

Hi all! 

 

First off, I have been using FM Pro for about 15 years.  While I designed basic databases, I never got real deep in.  That changed this past week when I decided to re-design my main DB.  This DB will contain injury records for high school athletes.

 

I have been trying to grasp relationships for the last 4 days, and I must say, its been tough for me to fdully understand them.  I did create a multi layer conditional value lists using a relationship, but I'm not completely sure how I did it though it works.  

 

Now I have a new desire.  I want to be able to create a script button that does the following.  If a specific injury is listed (in this case, a concussion), I want a script button that will create a new record in a separate table, then bring over the name, sport, and injury date to populate the corresponding feilds.  This is where the relaitionship comes into play, but after about 12 hours of trying, I just haven't gotten it done. 

 

I've read through about two dozen different threads on here to try to get the solution, but at this point, I think reading and trying so many have just lead to more confusion.  Any help provided would be greatly appreciated!!! 

 

(BTW, I've tried to remove the permissions, but Guest account has full access as does the user "Bill")

SOAP.zip

Posted

Actually, there's no real need for a relationship to accomplish that. You can use variables instead... Basic code from your original layout might be like

 

SetVariable [$injury: Value:OriginalTableOccurrence::Injury]
SetVariable [$name: Value:OriginalTableOccurrence::PlayerName]
etc
GoToLayout["InjuryDetails" (OtherTable)]
New Record/Request
SetField[OtherTable::Injury; $injury]
SetField[OtherTable::PlayerName; $name]
etc
  • Like 1
Posted

Thanks for the response!

 

That would be great and it looks simple enough.  But I imagine I might be running into a version issue as my Scriptmaker does not have the SetVariable option. 

 

I will likely be upgrading to FM12 over the summer when my budget is released, but I'm hoping to get most of the design in before implementing it.

 

Any other ideas?

Posted

You can use a global field instead of the Set variable.

Hmmm.  When I change the "name" field to a global global field, the same name appears across all the records.  Unless I'm not doing it right?

Posted

I mean to create a global field for this purpose. Call it anything like MyGlobal or something. Then instead of Set Variable, you Set Field MyGlobal.

 

This has been discussed many times in the past. Do this search in Google site: fmforums Set Global Field and it should get you started in the right direction.

  • Like 1
Posted

Thanks Lee!  I've been through the site looking at relationships, but this is the first I've heard that a Global field might work.

 

I guess this should have been in the Scripts forum after all. :idot:

 

Update: LOL, I'm still conpletely lost.  I understand if there was a Set Variable script choice.  That method is simple.  But using a Global Field is really boggling my mind.  Must be an easier way.

Posted

Thanks for moving the topic, Lee!

 

So I've continued to battle this problem for the last 3 days.  Just can't get it to click.

 

I've read over the Global Field help threads and pages.  It seems to be the most likely solution.  I just can't wrap my fat head around how to use them to accomplish what I want.

 

The worst part is, as I've been working on this one item, I've thought of a few more new tables where this type function would work and really help my overall database. :idot: 

Posted

Create a global field in ANY table. Globals can be accessed from anywhere even without a relationship. So just set the global instead of setting the variable and then retrieve the data from the global when you need it, wherever you need it. :-)

  • Like 1
Posted

So what would the script look like?  I've tried some of the following but most won't allow them to be inputted, saying the table cannot be found

 

SetField [$sport: Value:SOAP::MyGlobal]

 

???

SOAP.fp7.zip

Posted

user name and passwords

Username is Bill, no password for that file. The guest account also has full access.

Posted

"So what would the script look like?  I've tried some of the following but most won't allow them to be inputted, saying the table cannot be found"

 

There is no example in your file of a script where you try to set a field.

 

But now there is.

SOAP.zip

  • Like 1
Posted

Thanks Bruce!!!

 

I guess the biggest thing was I couldn't grasp how the Global field would capture the data and hold it until needed.  I did write a few script calculations that were somewhat similar but always had an error in not finding the correct table.  The biggest thing I see now is also the need to clear the global field after use, which makes complete sense. 

 

Thanks to all for the help!  As Lee hinted at, sometimes a little push in the right direction is HUGE! 

 

I also just found out that I might be able to obtain FM12 from my IT dept a lot sooner than expected, maybe as early as tomorrow.  That will be awesome!

Posted

Get the 30 free trial for FMP 12 and get started immediately.

 

BTW the choice to upgrade was a good one. FMP 7 is not only old, it was pretty buggy.

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