January 9, 200818 yr I'm utterly puzzled here, a developer calling his/her skill level Advanced should be abel to think the following up: Set Variable [ $what; Value:Invoices::CustID ] Enter Find Mode [ ] Set Field [ Invoices::CustID; $what ] Perform Find [ ] If this script is executed in a record will the found set after the run, be all the customers invoices. The result of over generalized is too often stabs in the dark, please descripe the context as well as purpose, next time asking! --sd Edited January 9, 200818 yr by Guest something daft in the scripting
January 9, 200818 yr Why the go to related step Soren? Seems it's not really needed unless I just need more coffee....lol
January 9, 200818 yr Author It doesnt work. Thats exactly the way I did it. Changed it to a global field and it works. Layoff the personal attacks!
January 9, 200818 yr How does it not work? What does it do? You could use Script Debugger since you have advanced so you can see what is happening. Edit: I missed the comment about you changing it to a global. Did you change the field to a global or the Variable? Michael Edited January 9, 200818 yr by Guest
January 9, 200818 yr It doesnt work. Thats exactly the way I did it. Changed it to a global field and it works. The variables are case sensitive so $myVar isn't the same as $Myvar ... similar are $$var different from $var, where the former are global, and the later stops working when the script terminates. Finally can't variables be transfered between files, for this use scriptparameters, and make them survive passing the boundaries by utilizing this technique: http://www.fmforums.com/forum/showpost.php?post/187787/ --sd Edited January 9, 200818 yr by Guest
January 9, 200818 yr Author Changed it to field global and it works. When it was a $variable I stepped it through and watched it in the the Data Viewer. It never showed up in the watch window; always showed up in the current window. This is what is causing me trouble. Very strange.
January 9, 200818 yr I'm sure Soren did not mean to attack you personally. He was, as I often do, trying to interpret what your goal was and why you were stumbling given the few details of the original post. If you are an advanced FM dev, finding with a variable is fairly routine, and so he dismissed that as the problem, given your rank. Soren's method works.
January 9, 200818 yr The variables are case sensitive so $myVar isn't the same as $Myvar That's not my experience.
January 9, 200818 yr Ahh! Once again David! you are Fermat'ting me again! http://www.fmforums.com/forum/showpost.php?post/277029/ I wonder why I've picked that up, have the DV changed behaviour when we upgraded to fm9 or... So this leaves back the scope to which a variable can survive, the bounderies are script for a single $ and the file for a double ($$), going beyond that, is largely considered bad habit by people drilled with object oriented designs: http://www.fmforums.com/forum/showtopic.php?tid/188219/fromsearch/1/hl/tokerud/tp/0/all/1/ At least something which needs to be approached with restraints, and repairing it with a genuine global field is IMHO even worse! --sd
January 9, 200818 yr Author Just figured it out! Set Variable[$$Find[3]; Value:css::part number] Go To Layout ["List" (css)] Enter Find Mode[] Set Field [css::part number: $$Find[3]] Perform Find[] Line 4 $$Find needed the [3]; you have to add this in in the Specify Calculation. Good old FM! Thanks for all your help.
January 9, 200818 yr You have a global variable with repetitions? You don't need that. You can change it to a local variable and remove the repetition.
January 9, 200818 yr Author Our part numbers have 3 repetitions; each part can have 3 different numbers. Do I still need the repetitions?
January 9, 200818 yr Thanks for all your help. I think that it was your skill to solve your problem, not the Forum's members
January 9, 200818 yr You have opened up a whole new can of worms. It's generally bad practice to use repeating fields. Without knowing your whole structure it's tough to say how you should have it set up though. In my experience I have found that repeating fields will only make you work more to achieve your goal. For example as soon as you decide you want to sort the repeating field you are stuck. Michael
January 9, 200818 yr Do I still need the repetitions? If the partnumber field is a repeating field, couldn't a single request distinguise each of the repeaters from the other, you're doing yourself a favour by having tree different fields, you can always modify 3 request, by the use of: http://www.filemaker.com/help/Script-Steps36.html See the technique here: http://www.filemakermagazine.com/videos/faster-or-search-script.html --sd
January 9, 200818 yr Your question is not clear. In general, a repeating FIELD is a single field as far as finding in it. So if you are searching for a value in any repetition of a repeating field, you can enter the value into any repetition in Find mode. I don't see what repetitions of a VARIABLE have to do with this. Perhaps you should elaborate a bit more when posting a question and save us the need to guess.
January 10, 200818 yr Author Soren: Sometime the light is slow to turn on! And I am sure you have times when your candle does'nt burn to bright. ;>)
Create an account or sign in to comment