How to get the last record ID created in a table ?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I've created a formula field like the following, and created a dynamic rule to set the formula field value to the original value, on form save (after checking).

[Manipulated]=[Original]+[Record ID#].

This sets only the same value again to original on saving the form for the first time since record ID is empty. When I edit and save second time, the record ID is appended. I'm trying to find a way to get the last used Record ID so that I can increment 1 and append it to original value.

If this is not possible, can someone please suggest a way to generate a unique number using Record ID on saving the form on first time?

Photo of Dinesh

Dinesh

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Mira Shnier

Mira Shnier

  • 0 Points
Can you explain your purpose as I am confused by the question.  The last used [Record ID#] for any record is the [Record ID#] of the record.  Can you explain with more detail what you are trying to do here?
Photo of Dinesh

Dinesh

  • 0 Points
Basically, I just thought to generate a unique code by combining the text given in another control with the record ID of the record assuming that it's always unique. At the same time, I just wanted to show the code in the new record form itself.
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
Dinesh - the Record ID# is already unique - is there another purpose for wanting to append text to the ID?
Photo of Dinesh

Dinesh

  • 0 Points
Yes, I need to append some text at the start and Record ID should appear the end. Ex: ABCDE123_XYZ_31 (31 is the record ID). Also, I need to make the resultant field editable in the edit form  after populating this unique code on save of the record for the first time
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
This script is a generic way to obtain the "last" value of a field identified by fid and label:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=474
Photo of Lina

Lina

  • 0 Points
Hi Dan, Thanks for this post. It is very useful. Furthermore, I want to ask something about a question I have and I don't know if you could help me. The question is: How can I get the information from an api_DoQuery?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
I don't understand what you are asking. Try posting a self contained question with relevant details of what you are trying to accomplish. It is difficult to answer questions if I have to reread the whole thread and then figure out the context of your new nine word question.

"How can I get the information from an api_DoQuery?".split(" ").length
9