Hot answers tagged

9 votes
Accepted

How to be sure API calls are using TLS 1.2

Check your Login History (under Setup). It now includes a TLS version column. There is also an equivalent field on LoginHistory called TlsProtocol. Another option is to change the API endpoint for a ...
9 votes
Accepted

Salesforce email says I'm connecting via TLS 1.0 but that protocol does not appear in login history

An interesting comment from twitter on receiving the email: Raised a case with [Salesforce Support]. They said they are sending it to everyone. @pranayjaiswal Case # 16169927 That would suggest ...
6 votes
Accepted

Trying to upsert product2 - Method not allowed?

To use PATCH, you need to make sure you're encoding the ID. Assuming the URL in your question was generated literally, that's problematic. The URL should look like: /services/data/v41.0/sobjects/...
  • 451k
4 votes
Accepted

Cannot implicitly convert type 'Salesforce.Common.Models.SuccessResponse' to 'string'

CreateAsync method returns SuccessResponse. It has three properties: string Id, object Error, and string Success. So, this should work: var response = await client.CreateAsync("Account", a); string ...
4 votes
Accepted

How to capture the nested fields on a lead object?

You will also need an Opportunity class with the fields that you have queried from ConvertedOpportunity. Something like (untested): private class Lead { public const String SObjectTypeName = "...
4 votes

Make Salesforce alert my program when a certain change happens

Yes, you'll want to read Setting Up Outbound Messaging for more info. Basically, you set up a workflow rule that triggers when the record is Closed Won, then Salesforce will send a SOAP-based message ...
  • 451k
4 votes

Push data from a website developed in .net to salesforce

If you have not gone through this Apex Web services Trailhead, then it is the best time to complete that. You need to create your Apex Class as a Web Service @RestResource(urlMapping='/Cases/*') ...
4 votes

How to check whether Apex class with specific name exists or not using C#.Net?

You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body ...
4 votes
Accepted

JWT Token always expires after 'exp' provided in the claims

RFC7523, which defines JWT authentication, specifies in section 3.4 that The authorization server MUST reject any JWT with an expiration time that has passed, subject to allowable clock skew ...
  • 88.9k
4 votes

c# .NET Example of using JWT OAUTH flow with salesforce

Maybe a bit late, but recently I came across the same requirement and rolled my own implementation. Youn could find it here: ForceDotNetJwtCompanion on github Brief description of the implementation: ...
3 votes
Accepted

Bulk Upsert with Salesforce .NET API

The Salesforce .NET Toolkit is a wrapper around salesforce standard REST API. Up until recently the Standard Salesforce REST API was only supporting single record actions per call and I believe that'...
3 votes

Sending a triggered send to multiple To/CC/BCC recipients via the API

The CC/BCC functionality is an additional feature that is typically not enabled by default. You can check to see if it is enabled by going into the TriggeredSend section under the Interactions Tab, ...
3 votes
Accepted

Accessing salesforce data from a VS console app

After adding the Salesforce Connected Services to a .NET console application you have a couple of things: It will have brought in the Force.com .NET toolkit from nuget It will have created a ...
3 votes
Accepted

Cannot Set LoginResult.serverUrl - UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

//LOGIN PART sforce.SoapClient sc = new sforce.SoapClient(); sc.Endpoint.Address = new System.ServiceModel.EndpointAddress("https://test.salesforce.com/services/Soap/u/34.0"); ...
  • 1,000
3 votes

Run Batchable class from .Net code

In addition to Daniel's answer, depending on your own preferences you could also create a custom Apex SOAP webservice or REST endpoint at which you launch your batch. Either of those is also easily ...
3 votes
Accepted

Run Batchable class from .Net code

Yes, you can use the Tooling API to perform execute anonymous calls in the same way you would from the developer console. See: Apexcode API: executeanonymous(). Tooling API REST API: /...
3 votes

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found

The endpoint URL from the login result will be for the Enterprise WSDL. It will be something like: https://na2.salesforce.com/services/Soap/c/32.0/0DF40000000001 Note the /c/ that indicates it is ...
3 votes
Accepted

OAuth JWT Token Bearer Flow returns Invalid Client Credentials

You are using plain base64 encoding, but JWT uses base64url, where - and _ are used in place of + and / respectively, with no = padding. You could do something like: static string ToBase64UrlString(...
  • 16.2k
3 votes

DescribeAsync Method usage using C# .Net API

Thank you Daniel, I've followed your recommandations and it works. What I needed in my C# .Net application was to get the Labels and Field names for custom objects, but also the content of the ...
3 votes

Simple SOAP Example in C#

C# has a SOAP bug with a WSDL. I vaguely remember that everything needs an attribute being the cause. Bug information is listed below. You can edit your WSDL to the following to fix the issue: ...
  • 591
3 votes

Bulk API client for .NET

If you don't want to manually perform the Bulk API calls from code you can use the Data Loader. This includes a command line interface that you could use to automate the process as required.
3 votes

The Id field should not be specified in the sobject data

In Salesforce, record Id's are generated when you insert any record. Once record id's are generated they become Read Only fields. Hence they cannot be modified. In above code, you're trying to make ...
  • 3,821
3 votes

Subscribing to a Channel with an Invalid ReplayId?

Best practice is to store replay ID value in your target system. You can then use it on resubscription to retrieve events from SF that are missing from your target. This works for short failure ...
  • 6,438
2 votes
Accepted

salesforce .net toolkit relationship query serialization

I assume you are using the Force.com Toolkit for .NET for this? In this case your SFLocation class should have a property of type Account that it called Account__r. And the Account class would have ...
2 votes
Accepted

Using Address type with Force.com Toolkit for .NET

There is no MailingAddress on a Person Account (Account), the addresses are PersonMailingStreet, PersonMailingCity, etc On a person Account only the BillingStreet, BillingCity, etc are available ...
  • 53.4k
2 votes
Accepted

Retrieving events from web services API

As Bachovski says, the most likely cause of the out of memory error is this infinite loop: for (int i = 0; i < results.Length; ) { cE.Add((ClickEvent)results[i]); } Because i is never ...
  • 131k
2 votes

.NET, CustomObject named in package.xml but was not found in zipped directory

The zip file (bytes) that you pass to the deploy method should not contain the /unpackaged folder. package.xml, /objects, and /permissionsets should be in the root of the zip. You should also set ...
2 votes
Accepted

Relationship Query issue

double check your endpoints Working against v34 and generate an wsdl with v35 (accidentally) will not work properly I do not understand why some querys will work, some not and the api response is so "...
  • 31
2 votes
Accepted

Generated SforceService.cs file from enterprise.wsdl is enormous. How to condense?

Salesforce provides two main WSDLs for accessing your orgs data via SOAP. Enterprise WSDL This is a strongly typed WSDL that is bound to the specific org it was generated from. It will have elements ...
2 votes

How to create bulk record using rest API?

The REST API doesn't provide a mechanism for updating multiple records simultaneously, like the Bulk or SOAP APIs do. You have two basic options: Custom REST Services, or Bulk/SOAP API. If you use ...
  • 451k

Only top scored, non community-wiki answers of a minimum length are eligible