April 13, 20196 yr 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.
April 13, 20196 yr 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!!!
April 14, 20196 yr 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.
April 14, 20196 yr 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).
May 30, 20196 yr 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