autoincrement field


I am using dtg_sugar_autoincrement-0.2-beta module to add an auto increment field to a custom module.
It works ok (more or less) if I add or edit using EditView form and perform Save.

I also created a function in another module to auto populate (automatic record creation) using the method save();
However, using this the autoincrement field is not updated.

Also, the same happens if I create the record using Workflow.

Any idea on what I need to change to accomplish this ?