Auto-Generating Calculated field

Good afternoon,

I am attempting to use a calculated field that is 5 digits long. The first 2 digits are for the year and the last 3 digits I would like to have autogenerate starting from 001. I've done some research and played around with some formulas but I can't seem to get it to automatically increment upwards.

I created: concat(subStr(toString($date_entered),8,2),"",subStr(toString(add(100)),0,3)) based off of the article here:Developing a counting field based on the last number used . I would creately appreciate another pair of eyes to see if I am doing something wrong or if this isn't possible to do.

Thank you,

David

  • Hi David Scarborough,

    In order to follow this example, your module needs an auto-increment field. You cannot make auto-incrementation through calculated fields. Custom code development is required to make an auto-incrementing field in a module that does not currently have one.

    In the linked example, Jerry's formula was:

    concat("Q", subStr(toString($date_entered), 0, 4), subStr(toString($date_entered), 5, 2), subStr(toString($date_entered), 8, 2), "-", subStr(toString(add($quote_num, 10000)), 1, 4))

    Highlighting only the "auto-increment" part:

    subStr(toString(add($quote_num, 10000)), 1, 4)

    The add() function means: $quote_num + 10000

    $quote_num is a stock, auto-incrementing field.

    This is what Jerry meant when we wrote: "We derive this from the built in quote number field."

    I hope this helps.