Creating a new SugarBean with a pre-created UUID

I have a custom API endpoint that we use to send a large number of records at a time. The endpoint works for updating records and inserting new records without a pre-created UUID, but when we send records with a pre-created UUID, we get the UUID back as a response, but the record is not written into the database.

To answer the questions this is going to cause, we do not use the bulk API endpoint due to a performance issue, since it is a http request to make multiple http requests. Also, we are a SugarCloud client so there is a 20 requests a minute limit, which is easy to violate. 

Does anyone have any insight as to why SugarBean might have an issue with new records with pre-created UUIDs?

Here is the code for the custom endpoint.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public function setEntriesMethod($api, $args)
{
if (empty($args)) {
return false;
}
$results = array();
foreach ($args as $module => $records) {
if (is_array($records)) {
foreach ($records as $fieldsArray) {
$sugarBean = $this->_processEntry($module, $fieldsArray);
$results[$module][] = $sugarBean->id;
}
}
}
return $results;
}
private function _processEntry($module, $fieldsArray)
{
$Logger = Factory::getLogger('default');
if (array_key_exists('id', $fieldsArray)) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parents Reply Children
  • Oops, sorry all. I tried to click on the Reply button but hit the down vote by mistake. I then had to switch it to an up vote as I couldn't unvote it. Apologies for voting for my own solution Disappointed