Is it possible to set CreatedBy and Owner when creating custom objects?

I am using Java API remotely to create custom object (using OAuth2 protocol). When the objects are created they have the admin owner & createdBy. This is damaging my data sharing policies and I would prefer to set the owenerId and createdBy fields on these objects - to match the user that created them.

Is it possible?

  • 2
    The owner can be changed easily by setting the OwnerId field on the object. The CreatedBy and CreatedDate fields can be unlocked by SalesForce to allow you to set them when creating/updating records. To do this you will need to raise a case with SF to get them to make the fields editable. I am not sure if SF will allow you to permanently have those fields editable.
    – BarCotter
    Oct 7, 2014 at 10:18
  • Is sharing policies are calculated by Owner? or CreatedBy?
    – Uri Lukach
    Oct 7, 2014 at 10:27
  • 1
    Owner but custom sharing rules can be configured to run off any field
    – BarCotter
    Oct 7, 2014 at 10:29


You must log in to answer this question.

Browse other questions tagged .