Forum Discussion

EOMDevelepors's avatar
EOMDevelepors
Qrew Captain
7 years ago

Lookup record before the current record

I needed to lookup a values of a record before the record I am currently on.

I created a formula [Record ID#]-1

I created a relationship pointing to the same table with proxy of this formula field

This should point to the record before the current record.

I added the fields I want to pull from the previous record but the data does not show up. When I look at the previous record it's there but its not pulling the values for some reason.

Am I doing anything wrong?

Thanks
  • 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
    • DrewVoge's avatar
      DrewVoge
      Qrew Cadet
      i'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)
    • EOMDevelepors's avatar
      EOMDevelepors
      Qrew Captain
      Thanks 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.