Forum Discussion
DrewVoge
7 years agoQrew Cadet
the record ID of any new record is not created until the record is saved for the first time. so, you probably want the self-relationship to include a summary field which is 'MAX - Record ID', so that you know the largest Record ID# CURRENTLY in existence
- DrewVoge7 years agoQrew Cadeti'd point out that your formula field that is currently [recordID]-1, would change to something like if(isnull([recordID#),[MAX-Record ID],[RecordID]-1)
- EOMDevelepors7 years agoQrew CaptainThanks for your reply. I am looking at saved records where the record id was already generated. I also see the record ID -1 showing up correctly. But the values of that record are not there.
- QuickBaseCoachD7 years agoQrew CaptainWhat is the reference field on the right side of the relationship?
- EOMDevelepors7 years agoQrew CaptainThe field that calculates my record ID - 1
The formula looks like this: [Record ID#]-1 - QuickBaseCoachD7 years agoQrew CaptainIt should work. I have done this before. I'm not sure what to suggest.
- EOMDevelepors7 years agoQrew CaptainThe problem was that the record ID was not the key field for this table.....
- QuickBaseCoachD7 years agoQrew CaptainI asked what the field was on the right side of the relationship, but not on the left!
Mark - EOMDevelepors7 years agoQrew CaptainThe right side shows the reference which is the formula field I created. The issue is that the formula should have been. [call ID]-1 not [Record ID#]-1 since call ID is the key field in my table. Now I need to lookup the Call ID before this one but some call ID are skipped since this is imported from a SQL server. Were you successful in adding a loop in a formula field? If I can do that I would loop until I find a Call ID that exists.
Thanks for your reply - QuickBaseCoachD7 years agoQrew Captainif only a few are skipped, then you could have [Record ID#]-2 and another relationship. Then on each record you have a formula checkbox field set to true. called [Parent Exists?]
Look that up to the child.
Then you have a formula field that is [Record ID - x (final)] which uses the value in [Record ID#]-1 if the first relationship found a parent, else [Record ID#]-2 if it did not. of course, you could continue this pattern up to even say 10 records back.
Then use the (final) field to have the "real" relationships and do your lookup fields just once from that relationship. So the other relationships are there just to figure out the correct parent to use in the (final) relationship.
So no looping. Quick Base does not loop in a traditional sense of my Fortran days
Do I = 1,10
.
.
.
Continue - EOMDevelepors7 years agoQrew CaptainLet me study this idea. Thanks