Discussions

Expand all | Collapse all

Is there a way to update the previous record in same table?

  • 1.  Is there a way to update the previous record in same table?

    Silver
    Contributor
    Posted 12-14-2018 20:55
    Hi everyone,

    Is there a way to modify the previous record in the same table?

    I want to modify some fields of the previous record whenever we create a new record.

    Any idea?

    Thanks,
    Gaurav


  • 2.  RE: Is there a way to update the previous record in same table?

    Bronze
    Contributor
    Posted 12-14-2018 22:21
    Run an Automation triggered on new record creation that applies to max (max [rid]) -1 ?


  • 3.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 18:24
    Is max[rid] a valid function?  I'm trying to use it in a formula url field and it's not working.  Does it only work in Automations?


  • 4.  RE: Is there a way to update the previous record in same table?

    Bronze
    Contributor
    Posted 12-19-2018 18:48
    Sorry, that comment wasn't meant to be usable code, just shorthand to communicate the gist of the idea. Mark, of course, has your detailed answer below.


  • 5.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 18:28
    You will need to set up a dummy table called like Max Record ID of the XYZ table with one and only 1 record in it.  It will be Record 1.

    Then make a relationship to your details table and make the reference field on the right side be a formula field which calculates to 1. The formula will be, well , 1.

    Then do a summary maximum of the [Record ID#] field and look that up down to the details table.


  • 6.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 19:17
    Whew!  Thank you again!


  • 7.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 20:18
    So, that'll tell you how many records are in the table, but it won't give you the actual highest Record ID#, will it?  If records have been deleted along the way those two numbers won't line up.  Is that right?


  • 8.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 20:37
    :) when you do a summary field, you can select a field to Summarize and so you will select [Record ID#]  and then choose a type of summary of  "Maximum


  • 9.  RE: Is there a way to update the previous record in same table?

    Posted 12-19-2018 20:40
    Bingo!  Thank you!