April 9, 201213 yr I have a membership 'type' of Regular. I can, via script, change it to Regular#. OK. But, if I run the same script to change it back to Regular it doesn't work. The get(foundcount) is 0. Ideas? Thanks Ron
April 9, 201213 yr I have a membership 'type' of Regular. I can, via script, change it to Regular#. OK. is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to find the exact match. You are using teh repleacefieldcontents via script ? Why not just set a Flag or something rather than adding the # at the end? -i Edited April 9, 201213 yr by imoree
April 9, 201213 yr Author My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want. I was just trying different things and I noticed that when I changed a previous Type to Type with a # that the ViewList would update but the find/replace functions would not. This seems to only happen with names that have #. is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to find the exact match. You are using teh repleacefieldcontents via script ? Why not just set a Flag or something rather than adding the # at the end? -i You are close. My script via 'onenter' collects the current $$PriorType name. Then onexit, it collects the $$NewType name. Next it does a search on $$PriorType. If the foundcount>0 it replaces $$PriorType with $$NewType. This find/replace function won't work if $$NewType has a # sign. Why? I don't know.
April 9, 201213 yr is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to find the exact match. -i Ian, what were the results when you tried doing exactly this and confirmed whether it worked before - yet again - submitting an untested and non-functioning suggestion?
April 9, 201213 yr The # is a special character. You have to escape it if you want to find it as a literal.: regular# http://www.filemaker.com/11help/html/find_sort.5.6.html#1050963
April 9, 201213 yr Ian, what were the results when you tried doing exactly this and confirmed whether it worked before - yet again - submitting an untested and non-functioning suggestion? Noted. .. Escape any filemaker special chars.. thanks
April 10, 201213 yr What about filtering the data directly in the field? if not i would use this to filter the data in the field via script: Filter( FieldTO::Filter ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqwxyz1234567890" ) this will allow only capital and lowercase alpha chars and numbers 0 -9.
April 10, 201213 yr Author What about filtering the data directly in the field? if not i would use this to filter the data in the field via script: Filter( FieldTO::Filter ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqwxyz1234567890" ) this will allow only capital and lowercase alpha chars and numbers 0 -9. Thanks for the idea. But, when I type Able #, for example, eveything reverts to Able *until after the script is run* then I get Able # Here is my little script: If[get(triggerkeystroke)="#"] show custom dialog set field[MemberTypePopup::MbrType; filter (MemberTypePopup::MbrType; "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ")] This results in the # still showing after the script is run. I have also tried SetField to "" and that command results in just #. The confusing part for me is that after get(TriggerKeystroke)="#" recognizes the # character FM proceeds, after the script is run, to put the undesired character back into the field. What's the point of that? Thanks Ron
April 10, 201213 yr Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/ Thanks for the idea. But, when I type Able #, for example, eveything reverts to Able *until after the script is run* then I get Able # Here is my little script: If[get(triggerkeystroke)="#"] show custom dialog set field[MemberTypePopup::MbrType; filter (MemberTypePopup::MbrType; "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ")] This results in the # still showing after the script is run. I have also tried SetField to "" and that command results in just #. The confusing part for me is that after get(TriggerKeystroke)="#" recognizes the # character FM proceeds, after the script is run, to put the undesired character back into the field. What's the point of that? Thanks Ron this is what i tested & works for Only the # character; you can enter any other you want to escape
April 10, 201213 yr "My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want." Huh? How do you report on membership types, then?
April 10, 201213 yr "My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want." Huh? How do you report on membership types, then? Good point!
April 10, 201213 yr Author The Type is field. It's contents come from popup list that refers to a table as it's source. To report on the Membership Types, I just refer to the Membership::Type field with a subsummry on Type. How is this relevant to keeping the # character out of the Type portal field?
April 11, 201213 yr How is it NOT related? Nobody knows; and at this point it is impossible for anybody to know: you are being extremely unclear. You said the type comes from a popup list; it restricted to limited values. And you said that the type can be ANYTHING; including the user arbitrarily adding oddball characters to the field such as the # character. Seems like time to upload an example or do a substantially better job of explaining the problem in detail.
April 11, 201213 yr Author Problem solved thanks to Imoree. He/she posted this link: Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/ which pointed out that, in my script, I needed to add Exit Script [False] which eliminates the trapped character. As usual, this forum came through. Thanks to all who read and responded.
April 11, 201213 yr Ian Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/ The FMForums provides a linking tool for this 9th icon, 2nd row.http://sixfriedrice....stroke-trigger/ or if you had left a space between the "out:" and pasted it http://sixfriedrice....stroke-trigger/ it would have also provided an ability to click on it.
April 13, 201213 yr Author Ian The FMForums provides a linking tool for this 9th icon, 2nd row.http://sixfriedrice....stroke-trigger/ or if you had left a space between the "out:" and pasted it http://sixfriedrice....stroke-trigger/ it would have also provided an ability to click on it. Great article. It really cleared up some 'fuzzy thinking' on my part about script triggers and their affects and sequences. Thanks for the links.
Create an account or sign in to comment