August 27, 200223 yr Hi, I've 5 fields(repeating fields,column) in my db. The problem I've is I can't copy all the fields at one go.(I want to copy the whole row at one go) Currenty I need to go to every fields to copy one by one to another file. I've written script to copy but the script only works for the first record.
August 27, 200223 yr Repeating? You mean that those fields should keep the same data through the comple database? Well you can set auto-enter from Previous record or special data, just using the Options choice in the Define Fields dialog.
August 28, 200223 yr Author Thanks for your reply. But what I want is: Item(field) Description(field) Price(field) (R1) 1 Candy 3.00 (R2) 2 Chocolate 5.00 I want to select the whole of row one(R1) to another FM aplication.
August 28, 200223 yr It's a bit tedious, but it can be done. To copy a whole row to a corresponding destination row, you'll need a script which transfers each value in turn. To do this, first create a global text field called "gTemp.txt" (assuming your repeating fields are text fields). Then create a script along the lines of: Set Field ["gTemp.txt", "GetRepetition(ItemField, 2)"] Set Field ["YourRelatedDb::RelatedItem"-2, "gTemp.txt"] Set Field ["gTemp.txt", "GetRepetition(DescriptionField, 2)"] Set Field ["YourRelatedDb::RelatedDescription"-2, "gTemp.txt"] Set Field ["gTemp.txt", "GetRepetition(PriceField, 2)"] Set Field ["YourRelatedDb::RelatedPrice"-2, "gTemp.txt"] Set Field ["gTemp.txt", ""] There's no escaping the fact that you'll need a number of scripts along the lines of the above, so it isn't a highly flexible solution, but it may be better than the manual alternative. A much better and more flexible approach would be to dispense with the repeating fields and use portals listing related records from a sub-file instead.
August 28, 200223 yr Further to my previous post, the inimitable 'Dj' has (on a thread elsewhere) suggested a more streamlined 'work-around' for the problem, and I thought it might be useful to you if I posted it here. (incidentally, the 'reason' for the difficulty which led me to suggest a two-step copy procedure for each value is discussed on the FMI knowledge Bnase article no 104269 if anyone is interested in the background) The more streamlined 'fix' is to include & "" after the GetRepetition function. Don't ask me why, but I tested it and it seems to work. Thus the seven steps of the script I suggested in the previous post could be compacted down to: Set Field ["YourRelatedDb::RelatedItem"-2", "GetRepetition(ItemField, 2) & "" "] Set Field ["YourRelatedDb::RelatedItem"-2, "GetRepetition(DescriptionField, 2) & "" "] Set Field ["YourRelatedDb::RelatedDescription"-2, "GetRepetition(PriceField, 2) & "" "] Which I'd have to say is tidier than the foregoing option (not to mention the fact that no global field is required...).
Create an account or sign in to comment