The new Summary function List will give you all Unique values from a field when you have show all records. Then check against that field and you can create your magic record creation
From what you are describing, the Trim function should work.
Can you show the script steps you are using?
Exact ( Trim ( "Walk " ) ; "Walk" ) = 0
Exact ( Trim ( "walk " ) ; "Walk" ) = 0
Exact ( Trim ( "walk" ) ; "Walk" ) = 0
Exact ( Trim ( "Walk" ) ; "Walk" ) = 1
i would verify that EXERCISES::gtype and EXERCISES_save::Type actually contains what you think they do from the context your operating from.
Things to look at:
The relationship between EXERCISES and EXERCISES_save.
What triggers the TRIM?
Are the data types for the two cols set to text?
Post the script and a screenshot of the relationship.
how are you trimming the value in the gType field? Is it a script trigger, validation, using a calculation to relate?
There may need to be a "commit" step in there somewhere.
Thanks everyone for your replies
johanhedman, good idea, but I'm using 12
philipHPG, so I thought, but no luck
coherentkris--all set to text. It does appear to trim in the dataviewer, as I can highlight the trailing space without trim but not when I apply trim.
@David Moyer--I tried trimming both ways, the field directly, and setting it as a variable and trimming. I did put some commits in there
Here's the file (created in FM Pro Adv 12) with some instructions if anyone wants to take a look.
Health-082516.fmp12.zip 29.4 K
After trimming, you need to set the global field gType back to the trimmed value, otherwise it won't find a match through the relationship.
Also, I'm not sure why your script is opening a hidden window.
So, for example, change line 13 of Save New Exercise to:
Set Field [ EXERCISES::gType ; Trim ( EXERCISES::gType ) ]
Thanks Philip, that was the trick. I didn't realize I had to set the global field back to the trimmed global field value in a separate step (it appears).
I only use the hidden window so I don't lose focus on the portal row. After commit it jumps to the top, and if I create a new exercise record it puts it in the wrong portal row.
I will continue tweaking to see if I can eliminate the hidden window.
you could always set the global field to be an auto enter calc of Trim ( self )