Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Active Record


Recommended Posts

Get(RecordID) will return the hidden, automatically generated, never-to-be-repeated ID# of the current record regardless of whether you are in list view, form view, or table view.


Get(RecordNumber) will tell you whether the current record is the 4th one down, the 216th one down, or whatever, within the current found set, which means in List View would tell you which line in the list is currently the active record.


If you tell us more about what you're trying to do, you'll probably get better answers. What do you mean by "id active record" and what do you expect to be able to do with the information once you've trapped for it?

Link to comment
Share on other sites

I'll try to explain it, when in list or table mode there's a black vertical line on the left side of the record, which tells you which record is the current record, as in record 8 of 54 found. I want to have something a little more obvious, such as a field color that changes. I can use a case statement and just need to know if there's a status flag or something I can use to evaluate.


Does that help?

Link to comment
Share on other sites



That's doable but unfortunately not in an elegant fashion (unless I'm missing a clue someone else would care to provide). There is no field definition function that will resolve to "RecordID of the currently active record whatever that may be". If there was, you could compare that value to the value of Get(RecordID) which, as a field definition, resolves, for each record, to that record's recordID whether it's the currently active one or not. (So if you created a field, RecID, defined as Get(RecordID), and put it on the list view layout, you'd see a consecutive string of numbers, each record "getting" its own RecordID and paying no attention to which record you've got your cursor on).


Nor is there a function such as Get(RecordActiveState) that would resolve to 1 whenever it happens to be the currently active record. That would be kind of nice but we don't have it. (The function Get(RecordOpenState) ain't it, unfortunately; it traps for whether or not a given record is being modified or not, which isn't the same thing)


Now, if you script your navigation, you can do it (e.g., set some global field to Get(RecordID) after going to the record of choice, and then having some calc container field set up like Case(g.SelectedID=Get(RecordID), g.ContainerSwatchRed). Because in a script, Get(RecordID) does reconcile to the RecordID of whatever record is the currently active one.


Yes, it could be done in a list view. Put a giant transparent no-borders button over the entire record's body, then send it to the back to bring all the fields in front of the button; then make every field in the layout body also a button. The main button just sets g.SelectedID to Get(RecordID), whereas all the other buttons (the ones attached to fields) have ScriptParameters and after setting g.SelectedID to Get(RecordID) they put the user's cursor in the field being clicked on. Problem there is, unfortunately, FileMaker didn't give us Go to Field [GetField(whatever)], so you have to set up a nasty string of If statements to test for the value of ScriptParameter:


If [Get(ScriptParameter)="Field A"

..Go to Field [Field A]

Else If [Get(ScriptParameter)="Field B"

..Go to Field [Field B]


But the nice thing about list views is that they generally don't have all that many fields on them. So yeah, it's klunky but possible.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Terms of Use