0

Finding last record in table

Hi,

I'm simply trying to find the last invoice created.

I am first using create record in the formula, then to use that record I need to grab the latest id.

To me this should just be : last((select 'Sales Invoice').id)

However it keeps returning 99 as the result even though the highest id number is 210. It isn't treating the id values as consecutive numbers? I have tried the same formula using 'max' but this doesn't return anything

2 replies

null
    • Birger_H
    • 4 yrs ago
    • Reported - view

    It should be:
    –––
    last((select 'Sales Invoice' order by number(_id))._id)
    –––

    Birger

    • Richard_Bramall
    • 4 yrs ago
    • Reported - view

    That's great, thank you Birger for your assistance

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 1677Views