Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

id_constant

Featured Replies

  • Newbies

I've been using FileMaker Pro for some time now, but some move advanced concepts are a bit foreign to me. I'm pulling apart the FMSP more for academic purposes at the moment, and I'm looking to start purchasing some training in the near future. One thing that is a bit confusing to me is the id_constant field that seems to appear all over the solution. I'm not certain what purpose it serves.

It’s a utility field often used to filter a relationship.

  • Author
  • Newbies

I sort of get why it's used, but what puzzles me is how it functions in certain situations. For example, when linking a contact with an account, it is what is responsible for the calculation to add the coloring and underline to the "Company" label. The field is a calculation with a "1" in it . . . I've walked through the linking process and can't find a single reference to how this field is set to empty . . . 

I also understand that this solution is provided for free and that a question such as this might be better received if I'm a paying customer of the training, but, I'm from the camp of "If you never ask, you'll never know the answer", so I thought I'd give it a go!!!

The id_constant field is never anything but 1. Hence it's called 'constant'. It's used to create a relationship with another table. In the case of this id_constant field, the relationship would link every record where the field in the other table has the value 1. Which field that is depends on the schema. But, as a simple example, it could be used to return all invoices that have the field 'boolean_completed' (if there were such a field) set to true (which is 1). Or return all invoices where the field 'boolean_error' (again, if there were such a field) is true. That would allow you to quickly review all invoices with an error.

image.thumb.png.3018a6bdfc9f358b3a149fdf8de056f1.png

 

I dug up an old copy of FMSP I had on my Mac. So, what they're doing here is checking to see if this Contact has a related company. They needed to "ping" a field that they know is there if there is a valid relationship. Typically, I'd check for the related record's primary key since that field is certainly one that you can count on. Not sure why they didn't simply check for not isempty ( Account_Name).

  • 1 month later...

Jim Johnson,

 

We use "id_Constant" as a static field that always has a value of "1". This is useful for a variety of reasons, but we typically use it for the following two reasons:

1.)  We use that field to relate everything to the "Preference" table. Every record, no matter where you are in the solution, is related to the preference record because of this field. That way we can check different things without having to set variables, or go back to the record every time. A good example of this is the logo on the top right of the screen. That image is in a field in the "Preferences" table, so if we ever need to change it, we can update it in the filed in "Preferences" and it updates across the entire system! It's super handy!

 

2.)  We also use "Id_Constant" to check if a record exists in the solution or not. Because it is always set to "1" if a check ever results in anything else, we no that there is no record on the other end. That's why we use it for the conditional formatting of the label you mentioned.

 

Thanks,

Jonathan Hogle

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.