how do i create an autoincrement field to generate a unique client ID for each client record? I'm using Sugar On Demand
Hi Jeremy Gardner
By default sugar will create all id's. So where you want to create and how you are creating.
If you are doing through logic hook then you can do as:
$meeting->id = create_guid();This create_guid() function itself placed in /include/utils.php file.
If you want to generate GUID in create-action.js version sugarcrm 7 do as:we can get it through app.utils.generateUUID();
Still it did not helped out.
Can you elaborate you question a bit with sugar version you are using
Hope this Helps..!!
S Ramana Raju
I am using the On Demand version, so i do not have access to the code, only the admin portal for hosted users.
I see there is the exact type of filed I need in the Cases module, but not in the Opportunities or Customers module, which is where I need it. Seems like a simple item to include as an option in all modules, not sure why it isn't there for some reason.
I was basically wondering the same thing! I have a client ID field, with 24k entries and I want the field to fill in automatically with the next client ID. Yet have no idea how to do so.
1. You have to create a Module Uploadable Package that can copy your Vardefs file to Sugarondemand server using below linkhttp://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Architecture/Extensions/Vardefs/#Module_Loadable_Package2. Create a file <file>.php inside your package as below that needs to be create for the <module>custom/Extension/modules/<module>/Ext/Vardefs/sugarfield_<name of auto increment field>.php
This Vardef file will have
$dictionary[<module>]["fields"]["<name of auto increment field>"] =array ('required' => true,'name' => '<name of auto increment field>','vname' => 'LBL_<uppercase name of auto increment field>','type' => 'int','massupdate' => 0,'comments' => '','help' => '','importable' => 'true','duplicate_merge' => 'disabled','duplicate_merge_dom_value' => '0','audited' => false,'reportable' => true,'calculated' => false,'auto_increment'=>true,);
$dictionary[<module>]["indices"]["<name of auto increment field>"] = array('name' => '<name of auto increment field>','type' => 'unique','fields' => array('<name of auto increment field>'),);
3. Now upload the package on Sugar on demand instance and do a Repair and Rebuild.
Hope this helps
In my opinion, you'd be better off using a solution that provides an easy way of generating auto sequence numbering of any kind (such as a prefix, suffix, separator,) and within any SugarCRM module.
Here is one such solution.
Hope it helps
Vincent, that solution is not listed as compatible with version 7, can you confirm if it works with the current version?
Sorry Jeremy, I hadn't noticed.Have asked the developers if a version for Sugar 7 is being considered
Hi Vincent Amari & Jeremy Gardner,
You can still consider my solution for creating auto increment field with custom vardefs.
Well, I wasn't looking forward to having to mess with something that technical. I'm not a developer or coder so it's not something that will be easy for me to figure out.
It's really pretty frustrating that something like this field isn't already part of the CRM. It's such a basic function that I would expect almost anyone to want. And it's there in a module already so why can't it be available in all the modules?
Just really frustrating...
Retrieving data ...