Hi all,
I have to insert leads directly via sql. my question is, how must i create the unique i? Is there a sample?
Best reagrds, thomas
Hi all,
I have to insert leads directly via sql. my question is, how must i create the unique i? Is there a sample?
Best reagrds, thomas
use the auto_increment algorythm. that would be enough.
Farkhad Rakhimzhanov
E-mail: farkhad@gmail.com
Skype: rakikama
SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
Book time against Cases, Project Tasks and Projects.
Create invoice regarding booked time, print it in PDF or HTML,
customize template as you like.
Hi Superman!
Could you please give me an example?
Thaks a lot, Thomas
Hi
Is it one time insert or you are developing some background logic in Sugar?
Anyway you can use as ID any strings which will be created by some unique logic created by you directly in SQL. For example if you want to insert a Lead 'John Smith' the ID can be something like this: 'johnsmith20071212063523'. Where 20071212063523 is current datetime or you can use timestamps. Or you can add any other info about lead into ID to make it unique.
Last edited by HolmesA; 2008-02-12 at 05:36 PM.
Ok, if it´s this way, it helps me a lot. Thank you ver much for your help!
As stated above you can use every unique id as you like. If you want to know how the "original" sugar ids are created have a look at YOUR_SUGAR_DIR\include\utils.php in the function create_guid().
As its quite simple function implementing it in sql is not that difficult.
Hi, all.
I believe the SugarCRM id like can be created with MySQL store procedure, once it is an md5 hash in 5 blocks.
Cheers.
--
André Lopes
Lâmpada Global Services
Rua Bela Cintra, 299 conjunto. 51
São Paulo, SP 01415-000
tel1. 55 11 3237-3110
cel. 55 11 7636-5859
e-mail: info@lampadacrm.com.br
hay Guys..
thanx a lot for the help..
Cheers
Yep, all of these answers are correct. It simply needs to be a unique string. We use a function that creates a guid (globally unique id), but you can use an custom mechanism you want as long as you end up with unique values.
Sugar Developer Zone - developer resources | Sugar University - user and admin training
Sugar Docs - user and admin documentation | Sugar Bug Tracker - Enter or view bugs
SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions
Clint Oram
Chief Technology Officer and Co-founder
SugarCRM
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks