how to create system genarated number data type field in the suitecrm.

Hi,

I’m modifying Lead module in the suitecrm. I want to create one field that field should filled with system generated numbers and those should be unique, and duplicate are not allowed.

is it possible to create field like that…?

Hi,

I don’t think you could do this out of the box, but it is entirely possible through other means:

A quick google search came across a post on the Sugar Forums about this, it could possibly point you in the right direction?: https://community.sugarcrm.com/sugarcrm/topics/the-mistery-of-the-auto-incremented-integer-fields

Or, you could try this add-on from sugarOutfitters: https://www.sugaroutfitters.com/support/cm-sugar-sequencing-addon/1378

if you don’t wish to do either of these, you would have to do this through custom coding. i.e: Logic Hooks.

Hi,

Thanks for your replay…

how to do in Logic Hook custom coding…?

Hi,

If you want to learn the basics of Logic Hooks, I find this blog post to be handy: http://cheleguanaco.blogspot.co.uk/2009/06/simple-sugarcrm-logic-hook-example.html
As well as the Sugar Developer Guide: http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Module_Framework/Logic_Hooks/

Also, I haven’t tested this so it may need some slight modifications to work with SuiteCRM, but there is a good post here: https://community.sugarcrm.com/sugarcrm/topics/how-to-create-a-unique-id-number-in-a-logic-hook
This post shows how to create a Unique ID for a record that relies on time/date, so it is very unlikely that the ID will be repeated.

thanks for your support… I’ll see these links let us know the answer…

May I also recommend this great (from my point of view one of, if not, the best) templates for creating your own logic hooks:

https://github.com/audoxcl/SugarCRMLogicHooks