We have a problem where the OwnerId field on the Lead object is not updating when we try and update it using this Saleforce .Net API wrapper.

The following process occurs.

  1. New lead is created
  2. Lead owner is set to a Queue via the "Default Lead Owner" functionality in "Lead settings"
  3. The OwnerId field is a polymorphic Lookup of Lookup(User,Group)
  4. Our code calls ForceClient.UpdateAsync passing in the LeadObject with OwerId set to a correct UserId
  5. ForceClient.UpdateAsync returns a success boolean and no error message
  6. The lead owner is not changed in Salesforce.

The code is rather simplistic:

public Response UpdateRecordsInSalesForce(string tableName, string recordId, object record, ForceClient client)
    var response = new Response();
        var recordSaved = client.UpdateAsync(tableName, recordId, record).Result;
        response.Success = recordSaved.Success;
        if (!recordSaved.Success)
            response.Message = $"Failed to save record because {recordSaved.Errors}";

We are new to integrating with the Saleforce API and I have seen a lot of answers mentioning triggers, etc. I have scoured our Saleforce instance and there does not seem to be anything undoing the update.

  1. Has anyone run into a similar problem with Lead.OwnerId?
  2. Can anyone think of a permission/ setting that we should check?
  • If you try to update any other fields together with OwnerId, does it work? – kurunve Mar 9 at 8:49
  • @kurunve we just tested changing Firstname & OwnerId. First name changed, but OwnerId did not change. – FryHard Mar 9 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.