August 14, 20169 yr Hello Everyone; i am tyring to get a type ahead working on my system regarding point of sale. The only issue i see is taking teh user to another layout to use the following type ahead system: If ( start > WordCount ( haystack) ; 0 ; Let([ needle = LeftWords(needles; 1); word = MiddleWords(haystack; start;1) ]; Case ( Left ( word; Length(needle) ) = needle; If( WordCount(needles) < 2; 1; FindWordPartsInText(RightWords ( needles; WordCount(needles) -1); haystack ; 1) ); FindWordPartsInText(needles; haystack; start + 1) ) ) )
August 14, 20169 yr I've spent a few minutes trying to decipher the calculation but gave up, too early in the morning. A couple of thoughts: - don't next IFs in CASE in IF: declare all you need to check up front in a LET() and do just one CASE; you'll thank yourself later and you'll make it easier to get help on what the calc is supposed to do - avoid implicit result interpreting. You call FindWordPartsInText() in both the IF and the CASE but you don't explicitly do a check that would rmake it clear what your intent is FindWordPartsInText( something) = true or FindWordPartsInText( something) = false or FindWordPartsInText( something) > 0 or > 1 We can sorta guess what you mean but make it explicit so that we (and your future self) don't have to guess. Explicitly state what you are checking. As to your question: can you rephrase? Why is going to a layout important? And what is it that does not work? You can't take the user to another layout? Or you can but the calculation does not give you the result you need?
August 14, 20169 yr Author 39 minutes ago, Wim Decorte said: I've spent a few minutes trying to decipher the calculation but gave up, too early in the morning. A couple of thoughts: - don't next IFs in CASE in IF: declare all you need to check up front in a LET() and do just one CASE; you'll thank yourself later and you'll make it easier to get help on what the calc is supposed to do - avoid implicit result interpreting. You call FindWordPartsInText() in both the IF and the CASE but you don't explicitly do a check that would rmake it clear what your intent is FindWordPartsInText( something) = true or FindWordPartsInText( something) = false or FindWordPartsInText( something) > 0 or > 1 We can sorta guess what you mean but make it explicit so that we (and your future self) don't have to guess. Explicitly state what you are checking. As to your question: can you rephrase? Why is going to a layout important? And what is it that does not work? You can't take the user to another layout? Or you can but the calculation does not give you the result you need? the calculation gives me NO RESULT on the layout i need it for.
August 14, 20169 yr in your example it is not clear where the values from haystack and needles come from. Can you post a real example showing where you get the data from?
August 14, 20169 yr Author 6 hours ago, Wim Decorte said: in your example it is not clear where the values from haystack and needles come from. Can you post a real example showing where you get the data from? Portal Filter calculation: IsEmpty ( GLOBALS::g_lookUp ) or FindWordPartsInText ( GLOBALS::g_lookUp ; Customers::FullName; 1) Issue is if i am creating a new record: the Customers information is not stored. Since Global searchfield is: a field in portal to trigger cf, then it does not find anything. see file attached: layout ( work order): Your Store.fmp12
August 25, 20169 yr Author Because of this issue, i have now learned about pickers and selector / connector. filemaker has grown so much. thanks Wim Decorte.
Create an account or sign in to comment