+ Start a Discussion
Ashutosh MohanAshutosh Mohan 

How to update N/A values in mandatory field

i want to update bulk record . in Object email field is mandatory ,i want to update with N/A all records
Training Salesforce 10Training Salesforce 10
There is a setting in Data Loader that allows for updating a field with a NULL value where values exist.

     To allow Null values to be included in an update:
1.  Launch Data Loader
2.  Select Settings
3.  Check box - Insert Null Values.

    Operational Sample:
1.  Run Export Data - include id, Column Field(s) that should be changed to blank.  (Make sure to keep the original export file as your data                       backup)
2.  Delete data contained in column(s) that should be returned as NULL (no values).
3.  Save new .csv with new name to avoid overwriting Data Export in Step 1 of this sample process.
4.  Run Data Loader Update using new file with Blank values.

Note: If the field being updated to NULL is referenced by a workflow or trigger, the update might not be successful.

  Data Loader Behavior with Bulk API Enabled using Insert null values-
 Example link-
   http://https://help.salesforce.com/apex/HTViewSolution?id=000163407&language=en_US (http://https://help.salesforce.com/apex/HTViewSolution?id=000163407&language=en_US)

Shiva RajendranShiva Rajendran
Hi Ashutosh,
Further more , you can't insert null values into mandatory fields.
You can update other fields as null.
In data loader insert null comes into picture when you insert a csv with empty cells for some field which is not mandatory.
Generally data loader won't let you insert null values to any field.
Hope this satisfied your requirement.
Thanks and Regards,
Shiva RV
Hi Ashutosh,

You can try inserting a bogus email for now, by you requirement I gather that you dont need email to be on the page layout.
I would say try "qwerty@abc.com" 

Hope it helps
sales force 48sales force 48
Hi Ashutosh Mohan,

You cannot prevent mandatory fields when you are inserting using dataloader.

David HalesDavid Hales
Hi Ashutosh,

There are three levels to making a field required: At the Schema Level, Validation Rule Level, and at the Page Layout level.
If a field is marked required in the Schema (Setup -> Customize -> Leads -> Fields -> Click Custom Field (Mark Required) than API calls will require the fields.
If a field is marked required in a Validation Rule (Setup -> Customize -> Leads -> Validation Rules (Valdiation Rule for Field) than API calls will require the fields.
If a field is marked required in a Page Layout ONLY (Setup -> Customize -> Leads -> PAge Layouts (Mark Field as Required in Layout Editor) than you WILL NOT need to enter it in the API for the SOAP call to work.
Note: There are some standard fields which are always required (Like LastName on a Contact) regardless of my help above. 
I would recommend the following approach:
1. Confirm if the Field is required at the Schema, Field Validation, or Page Layout level. Also confirm if it is a special required field like LeadStatus.
2. If this is at the Schema layer, than evaluate if you can turn it off as Required at Schema level and leave it as Required on Page Layout.
3. If need, change your integration to query / return the Lead object before you update it. That way you can fill in the required fields with what they currently are.
If all else fails, if you are performing an UPDATE than I would recommend you pull the Fields for that object that are required from SFDC first, than do the update. Assuming you are doing an UPDATE you should have SFDC ID. Simply pull the Lead via SOAP query, populate the required fields from the result into your new request, then do the UPDATE.

If the above suggestion worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future. 

Thanks & Regards 
David Hales(1044)
Kloudrac Software Pvt. Ltd.