September 28, 200421 yr Newbies ok so I came into a lab that was using FM and I learned how to get things working fairly decent. there were a few exisiting DB's and I was building tables off of those. Here is the thing I need to have something checked (ie need order) and then insert something into a second file. alright file 1 has a needed dropdown (yes/no) if yes then I need it to insert the item # from that record into a repeating field in a different file, I can open the file but I can't seem to get it to update anything in that file (file 2 = orders). loop... if(Exact ( "Yes" ; Lab Inventory Sort::Needed ) open file... (works) set field (file2::fieldx ; lab inventory...) so thats basically what I have and would like it to do but I guess I am just new at this and not too sure as to what I need in the script to insert values into file2. thanks for the help and will be happy to clarify whatever you need
September 28, 200421 yr You need to know the index of the repeating field. Once you know that, use the option in Set field for the repetition number. If the index is variable, then you won't be able to use a script; you'll have to do a calculation.
September 28, 200421 yr You need to get rid of the repeating fields and go to a proper relational design. You'll be much better off in the long run and even the short run. Transpower's suggestion will not work. Using standard Filemaker features you cannot set a repeat by calculation.
September 28, 200421 yr Bruce: Not true, you can set any index of a repeating field by a calculation; see some of my earlier posts.
September 28, 200421 yr If the index is variable, then you won't be able to use a script; you'll have to do a calculation. I don't think Bruce realized you were speaking of a calculation field, but rather Set Field, which must be hard-coded. You used the word 'set', which wouldn't be relevant to a calculation field.
September 29, 200421 yr And thanks, again, Queue, for your help with some of my earliest posts in this forum regarding repeating fields.
September 30, 200421 yr Author Newbies ok I can see how that will work but what is the syntax for an index? is it like fieldx[1] or what? Also I still have the problem of not being able to update anything in file2 after it is opened by file1--> would this just be easier to make a copy of file2 and put that into file1? Thanks a ton
Create an account or sign in to comment