imoree Posted August 14, 2016 Posted August 14, 2016 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) ) ) )
Wim Decorte Posted August 14, 2016 Posted August 14, 2016 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?
imoree Posted August 14, 2016 Author Posted August 14, 2016 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.
Wim Decorte Posted August 14, 2016 Posted August 14, 2016 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?
imoree Posted August 14, 2016 Author Posted August 14, 2016 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
imoree Posted August 25, 2016 Author Posted August 25, 2016 Because of this issue, i have now learned about pickers and selector / connector. filemaker has grown so much. thanks Wim Decorte.
Recommended Posts
This topic is 3264 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now