+ Start a Discussion
SFGSFG 

Updating lead through API returns this exact message "operation is not allowed"

Scenario
1) This is a FULL system admin account
2) Lead merge through API works fine
3) I've tested updating any field and get the same message
4) Update directly in Salesforce UI = success
5) Update through developer console = success
6) Update through the API and recording the debug actually shows it going into a post update trigger without issues - trigger just checks to see if the lead was converted and auto-creates a task. 

I work with the API all day every day and have worked on hundreds of client sites. I have never seen this before. I've looked at everything I can think of. All the obvious stuff checks out and has been tested again and again. Documentation says to make sure the record is marked as "updatable" yet there is nothing anywhere in the UI for such a thing. There is "Read/Write" which a full admin has. 

I will buy someone a case of beer if they can point me in the right direction. 

Ashish_SFDCAshish_SFDC
Hi , 


Need some more details about this issue, 

Paste the Debug logs and the Exact error message. 

See below links might be related, 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_non_mix_sobjects.htm

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_concepts_core_data_objects.htm

http://salesforce.stackexchange.com/questions/1865/mixed-dml-operation-not-allowed-original-object-cronjobdetail


Regards,
Ashish
SFGSFG
None of these links are related. This error happens on any field update on the Lead object. I can set the description to "test" and it comes back saying "operation is not allowed".  As per #6, there is literally nothing in the debug logs related to this error. It is as if it is being hit long before any of the apex layer is executed. One important note is that these opeations are being via OAuth. Again, this is totally standard for me and the org has whitelisted the IP etc. Also, like I said, Merge works just fine for some reason update doesn't work.
Ashish_SFDCAshish_SFDC
Hi SFG, 


Are you using .NET application to update the Lead via API?

See the link below, 

When using .Net to call the Update method on the API, you need to set the *fieldname__cSpecified* field explicitly. E.g.

updateParticipant.aDateField_StartDate__c = DateTime.Now;
updateParticipant.aDateField_StartDate__cSpecified = true;

http://stackoverflow.com/questions/9518268/update-not-working-in-salesforce-api


Regards,
Ashish