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

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

Recommended Posts

Posted

OK - new to FP. Hoping someone can help, since I'm overdue on solving this problem for our group.

attached is the file i'm working on. my main problem at present is that the first layout, called "PEPFAR_POS" allows the user to select a country from a pull-down menu, and then select on POS (clinic) within that country. (this works OK, although for some reason that I can't figure out, after selecting the POS, the focus goes back to the country select menu?!?)

then, the user clicks the button to go to the data entry on a specific patient, and i tied that to a script that should do the following:

  • go to the layout "PEPFAR_PATIENT"
  • enter browse mode
  • create a new record
  • insert the country code (depending on country selected in first layout)
  • enter the POS code (called the T1_CODE) based on the POS selected

nothing gets entered in the new record, though....

can anyone show me where i'm going wrong with my script?

thanks,

janaki

PEPFAR_ChartReview.fp7.zip

Posted

Janaki,

Okay. The reason the focus is going back to the country select menu is because you have 2 items on the page. When using a Dropdown list, after you choose the item, it enters it and goes to the next field... so when you pull down the second field and choose your item, it naturally can only go back to the next field - in this case, back to field one....country...

Thee are a couple of ways to solve this...

1 is to go into setting the tab order, and set the first field as tab 1, the second field as Tab 3 and the enter patient button as Tab 3, thus when you are done selecting the second item, the button will highlitght instead of Field 1.

2. Use Pop-up menus instead of drop-down lists.

3. Script it and include record commitment at the end of thescript.

Okay. Now in terms of your not entering anything...followthe script.... you are in record 1 when you start (or record x) .... when you enter the country and clinic, you are entering them into record 1 (or x) - then you click Enter and it makes a new record, record 2 (or x+1). Guess what information is still back in record 1 (or x)? your previously entered info.... hence, you need to make the Country and clinic fields global to hold the info as you change from record to record. (also clear the globals (setfield to "") after you setfields in your script so when the next person goes to enter data, it will be clear and not have thelast info in there...

Also...wait I just noticed that you didn't make your button run the script - you have it just going to a layout... make the button (right click, button setup, Perform Scritp, choose thescript name.

Do those things and see if it get's you closer...

Royce

Posted

Thanks, Royce, for the clear, step-by-step help!! I looked for where i could set the tab order, and thought i should be able to set it to go to the button....I'll look tomorrow (no FM on the home computer :) )

and now, i'll need to look into the global settings - that makes sense....so, does that mean that i take out the line to create a new record? anyway, i'll test this out tomorrow - you've given me a huge step forward! thanks again..

Posted

Janaki,

Tab order is ....

Layout Mode > Layouts > Tab Order [then set the order by clicking on the arrows] > OK Button on the Set Tab Order Dialog Box.

Regarding the new record...

You need to make it sometime. Your way is okay. Just make sure you clear the two fields (Setfield to "") at the end of your script AFTER you set the other fields (lest you have nothing to set!) so the next person starts off with clear fields.

Enjoy.

Royce

Posted

Royce,

thanks for all the great suggestions....in the end, i didn't need to use the global setting (i couldn't for the life of me figure out how to do it anyway!!!)

i discovered, after much playing around, that i had created an extra table that i didn't need. i ended up adding the Country and POS (clinic) fields to the Patient table, and then i was able to get the data to fill in appropriately.

my working version (still with a few problems, but with the first layout issue virtually solved) is attached.

when i got the original glitches worked out, i ended up having to add a button to create the new record at the top of the first layout, which surprised me - i thought that the layout should automatically start a new record.....is there a way to set a layout to create a new record as soon as displayed?

PEPFAR_ChartReview2.zip

Posted

Sorry - I've been unavailable the past week...

FileMaker doesn't have any non-button automatic scripting except when opening or closing a file - so you have to interact to make the new record - which in this case is okay because you don't want people making random new records when they go to that layout. On the other had, the THING YOU DO to go to that layout, could be scripted to add the new record after it goes to the layout - IF, you always want a new record each time you go to that layout...

Royce

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