• Maqsood Ahmad
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
I'm using REST API and updating a custom date field to null. My xml has below to represent null
<Registration_Date__c xsi:nil="true" /> which is mentioned at https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_xml_valid_records.htm

But' it's not clearing/flushing or setting null in sales force as I still can see old date in Registration field after the update.
It does update all other the fields but not the date and I do not get any error back. I get status code 204 back which is success.

When I set a date like below in xml
<Registration_Date__c>2017-05-15T00:00:00Z</Registration_Date__c>
It works and does update that date in Registration field.

Any idea why it's not updating to null??
duplicate value found: unknown duplicates value on record with id

I'm upserting an existing record by following https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm
and I'm getting error "duplicate value found: unknown duplicates value on record with id"
When I upsert new record it does create new record when I try to update same record through upsert I get above error.
Theoritaclly it should work as that's the purpse of upsert.

I need to use this upsert technique so that I can create/update multiple records through this technique.
I'm following this technique to upsert existing record

Any help to resove this issue??
I'm trying to authenticate REST API with BizTalk through following article
https://developer.salesforce.com/page/Calling_the_Force.com_REST_API_from_BizTalk_Server

and I'm getting Session expired or invalid exception
<Error><errorCode>INVALID_SESSION_ID</errorCode><message>Session expired or invalid</message></Error>
 
Any help would be appreciated.
Thanks
duplicate value found: unknown duplicates value on record with id

I'm upserting an existing record by following https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm
and I'm getting error "duplicate value found: unknown duplicates value on record with id"
When I upsert new record it does create new record when I try to update same record through upsert I get above error.
Theoritaclly it should work as that's the purpse of upsert.

I need to use this upsert technique so that I can create/update multiple records through this technique.
I'm following this technique to upsert existing record

Any help to resove this issue??
I'm trying to authenticate REST API with BizTalk through following article
https://developer.salesforce.com/page/Calling_the_Force.com_REST_API_from_BizTalk_Server

and I'm getting Session expired or invalid exception
<Error><errorCode>INVALID_SESSION_ID</errorCode><message>Session expired or invalid</message></Error>
 
Any help would be appreciated.
Thanks
Hello,

I have to perform a multiple upsert of the standard object Product using an external ID.
I found this https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm and this http://releasenotes.docs.salesforce.com/en-us/summer15/release-notes/rn_api_rest.htm#sobject_tree_resource but it doesn't help me.
Here is my Java code :
 
try {
			HttpURLConnection sfdcConnection = (HttpURLConnection) new URL("https://cs61.salesforce.com/services/data/v39.0/sobjects/Product2/External_ID__c/1?_HttpMethod=PATCH").openConnection();
			
			sfdcConnection.setRequestMethod("POST");
			sfdcConnection.setDoOutput(true);
			sfdcConnection.setRequestProperty("Content-Type", "application/json");
			sfdcConnection.setRequestProperty("Accept", "application/json");
			sfdcConnection.setRequestProperty("Authorization", "Bearer token");
			
			DataOutputStream dts = new DataOutputStream(sfdcConnection.getOutputStream());
			dts.writeChars(JSONFile);
			
			BufferedReader br = new BufferedReader(new InputStreamReader(sfdcConnexion.getInputStream()));
			String result;
			if (sfdcConnection.getResponseCode() == 200) {
				while ((resultat = br.readLine()) != null) {
					System.out.println(resultat);
				}
			} else {
				System.out.println(sfdcConnection.getResponseCode());
			}
		} catch (Exception e) {
			System.out.println(e);
		}

Here is the JSON file :
{
	"records":[
		{"External_ID__c":"1","Name":"Product1"},
		{"External_ID__c":"2","Name":"Product2"}
	]
}

Thanks,
COFFIN Brandon