2

I am trying to insert records from a csv file to salesforce leads abject using Apex dataloder. My Leads in csv file

Last Name | Company | Title  | Mobile      | Lead Status        | Website
Vineeth1    RK         HR      98786457123  Open - Not Contacted  Vineeth.com
Anuraj1     RK         Dev     96439841365  Working - Contacted   Anu.com

when i am trying to insert these records into the salesforce lead object using Apex dataloader, all fields other than Lead Status is getting inserted properly, but the lead status is always " Open - Not Contacted "

The lead status field has picklist values - "Open - Not Contacted", "Working - Contacted" , "Closed - Converted", "Closed - Not Converted".

the success report also contain the same way as in the record in csv file.

id |Last Name | Company|Title|Mobile    | Lead Status          | Website    | status
    Vineeth1  RK       HR   98786457123  Open - Not Contacted  Vineeth.com  Item Created 
    Anuraj1   RK       Dev  96439841365  Working - Contacted   Anu.com      Item Created

Can anybody guide me to do the proper way doing insertion using Apex dataloder. Please tell me what i am doing wrong.

2

I have had an issue with picklist values that contain dashes/hypnens: "-". If I have copied and pasted from a Microsoft Word doc into the UI field definition, it may paste in with a long dash character instead of a hyphen, because that's the character Word autoreplaced the hyphen with. Then any Apex that refers to this value using the hyphen character will not match.

The hard part about diagnosing this is that the picklist value looks the same in the UI itself; Salesforce will not display the dash, it displays the hyphen, even though the underlying value uses a different character. My solution was to delete that picklist value and recreate by typing it in again with an explicit hyphen.

For most picklists I would expect the record to accept whatever value is being loaded, but a standard field like Status may be restricted to only take the values it already has?

4

I can think of two reasons :

  1. You are not mapping the lead status field properly.
  2. A workflow or triggers is executed, by which the status is changing to "Open - Not Contacted"
  • Based on the description I'd go for option 2, it seems like you have some workflow or custom code updating the value after is inserted/updated. Set up a debug log to identify this. – PepeFloyd Oct 8 '12 at 12:59
  • it is not the reason because i am not using any workflow, it is my new dev ac in this i am trying to test it. And related to map i am getting the correct value in my success report i have mention it in the question. The issue is accruing when the record is getting inserted into lead object. – AnuRaj Oct 9 '12 at 4:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.