autoincrement field not showing in studio formula builder

Hi All,

I have created 2 fields auto increment field (field 1) and textfield(field 2)  and I want calculated formula in field 2 = concate("P",field 1)

but autoincrement field not showing in studio calculated formula builder.

If field 1 = 0001

then field 2 = P0001

Can anyone suggest, without coding how we can achieve above.

Kindest Regards,

Shreya

Parents
  • There are two ways of creating auto-increment fields in Sugar: with a logic hook and at the database level:

    support.sugarcrm.com/.../

    I suspect the reason you don't see that field available is that the auto-increment is set at the DB level when the record is saved, and therefore in the case of a new record being created it would not have a value to be pulled into the formula until after it's saved, so it can't be used in calculations that happen before the save, it's just not there.

    So I think you have two options:

    1) Create the auto-increment (field 1) and your textfield (field 2) in the before save as described in the document above.

    2) Leave the auto increment (field 1) at DB level and add an after_save logic hook to populate field 2, being careful to check that the value is null before the calculation (and save action) to avoid an infinite loop.

    FrancescaS 

Reply
  • There are two ways of creating auto-increment fields in Sugar: with a logic hook and at the database level:

    support.sugarcrm.com/.../

    I suspect the reason you don't see that field available is that the auto-increment is set at the DB level when the record is saved, and therefore in the case of a new record being created it would not have a value to be pulled into the formula until after it's saved, so it can't be used in calculations that happen before the save, it's just not there.

    So I think you have two options:

    1) Create the auto-increment (field 1) and your textfield (field 2) in the before save as described in the document above.

    2) Leave the auto increment (field 1) at DB level and add an after_save logic hook to populate field 2, being careful to check that the value is null before the calculation (and save action) to avoid an infinite loop.

    FrancescaS 

Children
No Data