How to get the last insert id from $GLOBALS['db']->query after running an insert sql statement?
If there a build up function for it?
Thanks!!
How to get the last insert id from $GLOBALS['db']->query after running an insert sql statement?
If there a build up function for it?
Thanks!!
You can create an New random ID using create_guid() before first insert and than use this ID in second insert as parent_id
More Info Here:
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Application_Framework/SugarBean/CRUD…
and here
HOWTO: Using the bean instead of SQL all the time. « Sugar Developer Blog – SugarCRM