I'm importing some data through the API, and I found I was not able to set the 'created_by' field when creating records. I thought I used to be able to do this, but maybe I am mistaken.
POST: <sugar_url>/rest/v11_16/Accounts
{ "name" : "test5", "date_entered":"2024-10-17T12:34:12-04:00", "created_by":"seed_will_id" }
I did notice that in SugarBean, there is a flag you can set (set_created_by), and so I tried that as well, but with the same result
{ "name" : "test5", "date_entered":"2024-10-17T12:34:12-04:00", "created_by":"seed_will_id", "set_created_by":false }
I see there is documentation to allow this to be done through the import wizard, but I haven't tested to see if it works. I've too many records to be importing data that way.
In the file:
SugarBeanAPiHelper.php:
There is a section that loops through all of the fielddefs and then if there are any matches in the submitted data, it'll add it to the save event. however, it looks like 'set_created_by' isn't in the field defs, so it never gets passed to the SugarBean save() process.
I can get it to work if I modify the core file like this so sugar thinks that set_created_by is a field.
Is this a bug, or intentional?
Thanks!