March 27, 20241 yr I have a text field with this autoenter calculation: List (Table::PrimaryID ; 1 ). It works fine and returns the PrimaryID + carriage return + 1. No problem with that. Is there a different behaviour if this field is used in a relationship that I don't know. Because in my solution, sometimes works some others it doesn't. Thanks.
March 27, 20241 yr 2 hours ago, Enigma20xx said: sometimes works some others it doesn't. Hard to tell what "works" means. What are you hoping to accomplish by having this field, and how exactly does it "sometimes" fail?
March 27, 20241 yr Author It’s been a few years now, and I hoped you remember English is not my native language, so I would have some kind of excuse, 🤣🤣🤣 3 tables. TableA, XREF/JoingAB, TableB From TableA via a portal I choose an ID from TableB (VL) to create a related record in the XREF/JoinAB. A field in this table (AB) autoenters a calculation ( List (TableB::Name ; 1 ). Not always the autoenter calculations works, does the job, functions... Sometimes it appears John + carriage return + 1. And some other times it only appears 1. And I don't know why this happens, and if it could be because I use this field in a relationship.
March 27, 20241 yr 15 minutes ago, Enigma20xx said: autoenters a calculation ( List (TableB::Name ; 1 ) That's very different from: 3 hours ago, Enigma20xx said: autoenter calculation: List (Table::PrimaryID ; 1 ) 17 minutes ago, Enigma20xx said: And some other times it only appears 1. If only 1 appears, it means the auto-entered calculation was evaluated while there was no related record in TableB. Try changing the formula to something like: Let ( trigger = B_ID ; List (TableB::Name ; "1" ) ) where B_ID is the foreign key to TableB. Make sure the "Do not replace…" option is unchecked. Still not sure why you need such normalization-breaking contraption.
March 27, 20241 yr Author Shouldn't it be? Let ( trigger = TableXREFAB::_ID ; List (TableB::Name ; "1" ) ) or Let ( trigger = TableXREFAB::TableB_IDf ; List (TableB::Name ; "1" ) ) 13 minutes ago, comment said: Still not sure why you need such normalization-breaking contraption. I try to make a filter for the portal. If the field has a name it shows it, but if it has 1, shows all.
March 27, 20241 yr I believe it should be: Let ( trigger = TableB_IDf ; List ( TableB::Name ; "1" ) ) (Since the field is in the same table as TableB_IDf, there is no need to include the TO name.) 20 minutes ago, Enigma20xx said: I try to make a filter for the portal. If the field has a name it shows it, but if it has 1, shows all. There are simpler ways to accomplish this. Ways that will not break if the related value is modified and the auto-entered value remains unchanged.
March 28, 20241 yr Author The new record doesn't get created in TableB, it gets created in the XREFAB table. I can't reproduce the issue in my example file, but I can't figure out what happens to my real solution... Ejemplo.fmp12 2 hours ago, comment said: There are simpler ways to accomplish this. Ways that will not break if the related value is modified and the auto-entered value remains unchanged. I'm open to advices... 🤣
March 28, 20241 yr 12 minutes ago, Enigma20xx said: The new record doesn't get created in TableB, it gets created in the XREFAB table. Yes, I understood that. But when you create that record and before you have entered a value in the TableB_IDf field, there is no related record in TableB, and the auto-entered calculation evaluates to "1". 15 minutes ago, Enigma20xx said: I'm open to advices... 🤣 Here is the simplest way I could think of: FilterByCategory.fmp12
March 28, 20241 yr Author 19 minutes ago, comment said: Here is the simplest way I could think of: As always, a master class. The simpler the better. 🥷 Thanks.
March 28, 20241 yr Even simpler: Give your portal an object name and use Refresh Portal instead of Refresh Window.
Create an account or sign in to comment