Announcement

Collapse
No announcement yet.

Using Auto-increment value in before save script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Auto-increment value in before save script

    Hi,

    I have a question regaring auto increment fields...
    I am giving my leads an ID (auto increment variable called cId) and I giving them a string name that is used for several purpose containing that cId.

    I set up this cId as auto increment which works fine.
    Then I try a dummy test:
    $idstr = cId;

    $idstr is always empty or zero, tried with number format and so on.

    What am I doing wrong here?

    Best regards
    Lukas
    Last edited by MrLue; 07-08-2024, 08:23 AM.

  • #2
    as far as I know, you can`t calculate increment fields by formula, as it is a database based value. If you could calculate it, it would cause problems with duplicates, regarding deleted records and so on.

    Comment


    • #3
      Hi.
      I don't want to calculate the incement field, i just want to use it in calculation of other variables, e.g. a text field.
      However, the auto increment field value is always zero or empty when i use it in the script - could it be that auto increment fields are calculated after the save process is finished?

      Comment


      • #4
        You need an afterSave hook as it won't work with beforeSave formula.

        Comment

        Working...
        X