November 25, 200520 yr I want to create a new record in a database, using a portal, then add to that record using the related data. I was just doing GOTO last portal row, then GOTO specific field, then instert field x into field1, and then insert field w into field2, etc. But every time I do this it either updates the very first record in the portal list, or, if I play around with a goto portal row command, starts creating new records for each value. I'm sure I'm missing some basic element here.
November 25, 200520 yr Author I guess I need to say that this is a looping script and the first one works fine, but the next loop and there after will insert into the first records fields only.
November 26, 200520 yr A lot of the developers I know of turns the "allow creatio..." of in their relations def. and creates new records in the related file instead, because the modality of the dangling new record violates some interface rules. This have become much more supported under fm7 and upward ...but since you're on fm6 still, should you consider setting global fields in the related file via another relation and use these as source for the autoenters that happen when a new record is created beyond the recordID ...what I'm saying is that every field could be an autoenter. We have taken it for granted that data stored in the portal is of historic nature such as lines in an invoice. Often do we need sets of items to be entered with prices etc. which only requires minor adjustments to itemcounts in a few lines perhaps. Ideally should this be solved via a recursive relation, but we can cheat an use the idea behind this template: http://www.dwdataconcepts.com/dl/tw/compinv2.ZIP ...that although it's for an earlier version, still shines in it's simplicity to implement. --sd
November 28, 200520 yr chevell, Your loop can still work if you first go to the last portal row, then add your data. If you must leave the portal in the middle of setting fields, use a global to hold the current portal row number, then use Go to Portal Row [ by calc ] with your global, to return to the correct row.
Create an account or sign in to comment