Jump to content

Scripting beyond my knowledge


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

Recommended Posts

I'm creating a database for the law firm I work for. I've set up a drop-down menu listing the different types of documents that are written. There's about 20 different documents so I really didn't want to create individual buttons. What I would like is to choose a document off of the menu and then press "go." I know there's a way to do this. It's just not coming to me. Any suggestions?

Link to comment
Share on other sites

Here's the plan:

1. Choose document to create from menu, i.e. Fax, letter, etc.

2. Click "go" button.

3. DB goes to layout corresponding to menu choice.

Now, here's the tricky part (for me anyway). The document is part of a related database, since we are required to keep track of any document produced related to a case. Therefore, the corresponding layout is in another database. Now, the setup described above is part of a portal. Everything else about it runs perfect. It's just this one little script that giving me a hard time.

Edited by Guest
Link to comment
Share on other sites

Oscar

Sorry, I haven't got the time to go through this step by step at the moment but here is an overview of what you have to do.

Put a button on the first line of your portal.

Attach a script to this button that calls an external script that resides in the related file of the portal. It might be a series of if's ie

if your menu field = 'Fax'

Go to layout fax

endif

If your menu field = 'letter'

Go to layout letter

endif

etc.

Hope that helps for now but if you need further help get back to me and I will give you a more detailed description in the morning

Regards

Phil

Link to comment
Share on other sites

Hmmm...That got it to work. Sort of. What I'm trying to do make so that what layout in the child db is dependent on what choice is made in the drop down menu, i.e., "Fax to Client" is chosen, you click go and you are sent to the "Fax to Client" layout. If "Fax to Opposing Counsel" is selected, you're taken to the "Fax to Opposing Counsel" layout.

For some reason, regardless of the choice on the drop-down menu, you get taken to the exact same layout. It seems the "if" function is merely a true/false option and I need about 10 choices.

Reading the help file, I'm starting to think FM might not be able to do this.

Edited by Guest
Link to comment
Share on other sites

Hi Oscar,

FM can DEFINITELY do what you want.

Try putting a 'Go to Related record' step in the script in the first file before the perform external script step (sorry I should have mentioned this last night).

This will move the record pointer in the related file (the one in the portal) to the record that the button is next to in the portal.

When the external script is now called, the active record will be the one that you selected via the go button in the portal so when your if statements are checking for which layout to go to they will be checking the record that you selected and so should act accordingly.

Without the go to related record step the record pointer in the related file never moves hence you were always taken to the same layout

Further, you are correct that the if function is a true false function so you will need 10 of them. After each go to layout step also include an exit script step.

if your menu field = 'letter'

go to layout letter

exit script

endif

...repeat 10 times with relevant choices

The script will now step down through the 10 options until it has found one to be correct. It will then take you to the correct layout and then get you out of the script

HTH

Phil

Link to comment
Share on other sites

Hmmm....didn't help. I'm wondering if it is in how I am naming things. I know FM can be very picky about /'s and such. Here is my script:

1. If["Document Type = "Fax/Counsel""]

2. Toggle Window [Minimize]

3. Go to Related Record ["GME2"]

4. Perform Script [sub-Script, External:"GME2.fp6] <-This is my script to send to "Fax Counsel" layout.

5. Exit Script

6. EndIf

7. If["Document Type = "Fax/Client""]

8. Toggle Window [Minimize]

9. Go to Related Record ["GME2"]

10. Perform Script [sub-Script, External:"GME2.fp6] <-This is my script to send to "Fax Client" layout.

11. Exit Script

12. EndIf

Now, I know it's partially working because none of the other choices in the drop-down menu take you anywhere when you press "Go."

I'm thinking there's another way around it. Instead of individual choices for Fax/Client, Fax/Counsel, etc. I could just use Fax and then, give the options of Client, Counsel, etc. in the child file.

Link to comment
Share on other sites

I don't think there is a Toggle Window [ Minimize ] option (at least not in OS X.) But if that's the same as Toggle Window [ Hide ], it may the problem. That would cause the focus to be lost before the Go to Related Record, so it wouldn't be on the selected portal row anymore.

Try moving the Toggle Window to be after the Go to Related Record.

Link to comment
Share on other sites

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