function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aravind swaminathanaravind swaminathan 

How to remove manager/make it null on user object

Hi All,

I am trying to update managerid field on user object using upsert method.My requirement is to make it null/ remove the existing manager name when i run my update process with new managerid.If it doesnt find the new managerid in salesforce, it should remove the old manager id and make it null.How to accomplish it?I tried passing null and "" to manageriod field on my upsert method without any luck.If someone can help, it would be great.

Thanks,
Aravind.
Daniel BallingerDaniel Ballinger
Since you are using .NET to work with Salesforce I'll assume you are using the Partner API via SOAP. If so, to null out a field you need to set the fieldsToNull property on the sObject before sending it upsert.

See Core Data Types Used in API Calls (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm)