h.mandle (Customer) asked a question.

update value of global variable.

update value of global variable. I have use-case where i need to generate next max number for an ID field which starts with 10000 as first number. I was thinking about using global variable and update the value of global variable by 1 every time there is new request. so question is?

 

did anyone come across such use-case in past? and what did you do?

did anyone update global variable value using database update query in workflow?


  • h.mandle (Customer)

    This is exactly is what i am doing at the moment, have attribute on account which i am using to generare next big number; but was just trying to see if anyone used global variable and what SQL Table i can use to update that. Please do share table name if you already know :)

    Selected as Best
  • I guess you can use global variables for this use case. Haven't used it in that manner.

    Note that global variable can be updated from the UI which will break your process.

     

    Instead of using global variable, maybe query the DB where the ID stored, find the largest values and increase by 1?

  • h.mandle (Customer)

    This is exactly is what i am doing at the moment, have attribute on account which i am using to generare next big number; but was just trying to see if anyone used global variable and what SQL Table i can use to update that. Please do share table name if you already know :)

    Selected as Best
    • global variables are stored in T_AV_GLOBAL_VARIABLES

       

      If you have this use case already configured and working, any specific reason why you want to change it to work with global variables?

  • TimWillemstein2 (Customer)

    I think the safest way to do this is to setup a sequence and call it to increase it by one for every call. No worries about duplicates since this is not possible.