[SalesForce] Command line Upsert error

I am new to SalesForce (a former Goldmine user), but have dealt with mapping before. I am trying to set up the data loader so that I can run it from a batch file each night and insert / update our accounts. I have successfully run the upsert from the Data Loader Wizard and have saved the mapping as a .sdl file. The accounts are linked on an external id field; SalesForce custom field RMAcctNbr_c = CID, the field name in our csv file.

Here's the mapping from the sdl file:

Mapping values
Wed Nov 07 10:47:38 EST 2012
ARTotal=AR_Total_c
Addr1=BillingStreet
Zip=BillingPostalCode
AcctOwner=OwnerId
JobReq=JobReq
_c
RepName=SlsRep_c
LPymt=LstPay
_c
CID=RMAcctNbr_c
POReq=POReq
_c
State=BillingState
AROver30=AR_Over_30D__c
AROver60=AR_Over_60D__c
AROver90=AR_Over_90D_c
StatusDesc=Status
_c
Phone=Phone
CName=Name
LActivity=LstTrans__c
FaxNbr=Fax
ARCurr=AR_Current_c
City=BillingCity
TerrName=Terr
_c
AROver120=AR_Over_120D__c

I've created the upsert bean in the process-conf file, but I think there's a problem with the following line:

[entry key="sfdc.externalIdField" value="RMAcctNbr_c"/]

where the brackets are actually '<' and '>' (sorry….didn't know how else to get it displayed correctly in this message)

RMAcctNbr_c is a custom field in SalesForce that contains a unique account number that is mapped to the CID field in my csv file.

When I run this command line from the batch file, it throws the following error:
ERROR [accountUpsert] client.PartnerClient runOperation (PartnerClient.java:332) – Error while calling web service operation: upsert, error was:
[InvalidFieldFault [ApiQueryFault [ApiFault exceptionCode='INVALID_FIELD' exceptionMessage='Field name provided, RMAcctNbr_c does not match an External ID for Account'
]
row='-1'
column='-1'

Any help would be appreciated!

Best Answer

Is the field RMAcctNbr_c defined as an external ID in your Salesforce org?
Under Setup | Customise| Accounts | Fields then edit the field RMAcctNbr__c.
Under General Options there is a checkbox "External ID" which you must check if the field is an external ID. This will also index it, which can improve performance. If memory serves, you can have at most 3 external IDs per object.

Edit : Also as Mikey has pointed out all custom field names end double underscore c __c so check how you have entered the field names.

Related Topic