Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi folks,

I have 2 tables. Table A contains essential info about patients, and Table B contains dated consultation notes. The tables are linked via the "Client ID" field.

I have created a button on a layout for table A showing individual records which, when clicked, opens a table list view of the related consult notes for that client, from table B.

When in this table list view, showing an individual client's list of consult notes, if I select "new record" from the menu, a new blank row appears ready for more consult notes, however is NOT automatically associated with the current client ID.

How can I set this up so that when new consult notes are added to a current list (related to a given client ID), they are automatically assigned the currently 'active' client ID?

(e.g. via scripts/button or other) I'm not 'script proficient' so you'll have to spell that one out.

Thanks

DrChris

Posted

Why not create a portal to the notes records, in the client layout?

But at any rate, your script would be:

Set variable[ $clientID; Notes::ClientID]

New record

Set field [ Notes::ClientID; $clientID]

Posted

Thanks Bruce,

Will give it a go.

I did try the portal option, however, my visit notes table contains a field container for images which I need to be able to see readily, and as far as I can tell, the portal is more limited in how I large I can display those images.

Keep in mind that this is ultimately running on an ipad via filemaker go, so screen realestate is somewhat limited.

Chris

Posted

Back again,

Tried the suggested script but quickly realised I am not clear on some of the syntax. Below are the actual table names I'm using, and wondered if you'd mind filling in the blanks with the correct bits.

Main table = Animal Chiro v3

Consult notes table = Visit Notes v3

Common filed = Client ID

Thanks

Chris

Posted

Well, you could set the ClientID field to auto-enter a calculated value =

GetNthRecord ( Notes::ClientID ; 1 )

However, this could bomb if the found set is changed. The thing is, when you are in the Notes table, there is no "currently active client".

Posted

Well, you could set the ClientID field to auto-enter a calculated value =

GetNthRecord ( Notes::ClientID ; 1 )

However, this could bomb if the found set is changed. The thing is, when you are in the Notes table, there is no "currently active client".

I figured that by putting a button on the Client's main page, that linked me to their related records from the consult notes table, I was basically looking at the results of a search based on the Client ID.

However, I have wrongly assumed that if I then added a new record, whilst the found related records were still showing, it would be added for the same Client ID.

Also, the button doesn't work (i.e. link to related records) if there are no existing consult notes for that Client ID, nor does it automatically generate a new one for that client.

Looks like I need to do some more learning before I go further.

Chris

Posted

the button doesn't work (i.e. link to related records) if there are no existing consult notes for that Client ID, nor does it automatically generate a new one for that client.

You could do something like this (roughly):)

If [ Notes::ClientID ]

Go to Related Record [ Notes ]

Else

Show Custom Dialog [ "There are no notes. Create a new note?" ]

If [ Get (LastMessageChoice) = 1 ]

Set Variable [ $clientID ; Clients::ClientID ]

Go to Layout [ Notes ]

New Record

Set Field [ Notes::ClientID ; $clientID ]

End If

End If

I have wrongly assumed that if I then added a new record, whilst the found related records were still showing, it would be added for the same Client ID.

There is no memory of how you arrived at a layout, nor of how you created the found set. That's why auto-entering the ClientID is a rather iffy proposition: it assumes you wouldn't create new records in the Notes table under other circumstances.

Posted

Thanks Bruce,

Will give it a go.

I did try the portal option, however, my visit notes table contains a field container for images which I need to be able to see readily, and as far as I can tell, the portal is more limited in how I large I can display those images.

Keep in mind that this is ultimately running on an ipad via filemaker go, so screen realestate is somewhat limited.

Chris

You can make the portal row height whatever you want, just as you can with the notes list view. You can also create a "selected note" feature and show only the image for that note if you want.

Posted

You could do something like this (roughly):

If [ Notes::ClientID ]

Go to Related Record [ Notes ]

Else

Show Custom Dialog [ "There are no notes. Create a new note?" ]

If [ Get (LastMessageChoice) = 1 ]

Set Variable [ $clientID ; Clients::ClientID ]

Go to Layout [ Notes ]

New Record

Set Field [ Notes::ClientID ; $clientID ]

End If

End If

That looks like a good option.

Definitely have to learn a lot more about scripting!

Posted

Just to check though,

where I see the expression "$clientID" as people type it in these posts, do I have to enter anything here (other than the correct field name)?

i.e. is the $ sign a variable I have to manually enter when designing the script, or just leave it as is?

Posted

[color:blue]$clientID is the name of the variable you are creating - you can use any other name, if you like.

[color:blue]Clients::ClientID is a (fully qualified) name of a field - you need to use the actual name of your field here.

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