The CreatorCon Call for Content is officially open! Get started here.

Auto numbering an asset tag using a business rule

othomas1
Kilo Guru

Hello all,

Is it possible to auto-number the alm_asset table using a business rule? I have very little experience dealing with business rules. Below is the code i tried at first with just populating the asset tag field with a value of 3, just to see if i could make some progress, no luck. Any tips or suggestions are welcomed.

 

 

find_real_file.png

find_real_file.png

 

1 ACCEPTED SOLUTION

Nia McCash
Mega Sage
Mega Sage

A before Business Rule would only execute when you try to save the record so you don't actually get to see the value of 3 in the form.  Rather, if you saved the record, you should find that the Asset Tag value is 3 when you pull up the saved record.

You might want to use the auto-numbering feature (the same feature that sets automatic incident numbers when you create incidents).  See documentation at: Add auto-numbering records in a table

You can set the default value of javascript:getNextObjNumberPadded(); on the Asset Tag field and possibly avoid Business Rules all together.

View solution in original post

5 REPLIES 5

othomas1
Kilo Guru

*Auto number the asset tag field within the alm_asset table.

Nia McCash
Mega Sage
Mega Sage

A before Business Rule would only execute when you try to save the record so you don't actually get to see the value of 3 in the form.  Rather, if you saved the record, you should find that the Asset Tag value is 3 when you pull up the saved record.

You might want to use the auto-numbering feature (the same feature that sets automatic incident numbers when you create incidents).  See documentation at: Add auto-numbering records in a table

You can set the default value of javascript:getNextObjNumberPadded(); on the Asset Tag field and possibly avoid Business Rules all together.

othomas1
Kilo Guru

Thanks Nia,

 

I ended up going with getNextObjNumberPadded(); on the Asset Tag field when the model category is software, the only drawback i see is that since i went into number maintenace and added a prefix, the prefix now shows in the asset table when creating a new asset.

 

 

find_real_file.png

I haven't tested this so you will have to test first ....

See if you can delete the 'Number' field because it seems unnecessary at this point. If doing so breaks the auto numbering functionality that you want for the Asset Tag, then I'd leave the field there but just remove it from the Form Layout.