Hot answers tagged

19 votes

Salesforce Metadata Api/ Tooling Api to build changesets

It turns out you can directly retrieve and update changesets directly with the Metadata API. Via Sean Harrison‏: Pro tip: U can retrieve the contents of a change set incl. manifest with the ...
15 votes

Does Apex have an equivalent to the C# object initializer?

The correct answer is it depends. Currently salesforce only accepts that for sObjects. Other Objects (1) cannont be initialized that way. You can however, create custom constructors like: public ...
12 votes
Accepted

Ensuring my application complies with SSL3.0 being disabled?

The protocol used will depend on the .NET version you are using. If running under .NET 3.5 it will support TLS1.0 by default and fall back to SSL3 if it fails. With .NET 4+ the default is also TLS1.0 ...
9 votes

Determine if instance has Multi-Currency Enabled

Boolean multiCurrencyEnabled = Schema.getGlobalDescribe().containsKey('CurrencyType'); If this check is true, it's safe to use CurrencyIsoCode fields and the CurrencyType object. I'd recommend using ...
  • 445k
8 votes
Accepted

Does Apex have an equivalent to the C# object initializer?

This is the syntax Student student = new Student(FirstName = "Jane",LastName = "Doe");
8 votes
Accepted

Apex Code - Region for as C#

#region and #endregion define a code folding unit. The Apex extensions for Visual Studio Code added support for these directives in 2018. The directives must be located in comments; #region ...
  • 88.2k
7 votes

Request was made to the incorrect endpoint

You need to check what location your MC instance is on. Find this in the URL mc.[ ].ExactTarget.com Use the matching endpoint connection your development environment: S1 Instance https://...
7 votes

How can I encrypt a string in Apex in a way that an external system can decrypt using C#?

David is absolutely right and I'd like to add some extra information and provide code examples regarding Apex-encryption/C#-decryption. To encrypt some String in Apex using the AES256-CBC algorithm ...
6 votes

Return more than 2000 records (SOQL)

I'm using simple_salesforce for python and ran into the same issue where there was a limit on the number of records returned. But that's because I was running sf.query(my_SOQL_query) instead of sf....
6 votes
Accepted

Object Reference Error on "Automation" RetrieveRequest

Add the ProgramID to the Properties list when making the retrieve. The Automation object has a few issues with it.
  • 590
6 votes
Accepted

Chimera Scanner testing server with no login credentials

If you don't provide credentials, we'll simply scan the site unauthenticated. If credentials are provided, we'll do our best to automatically login (this feature isn't perfect yet, but we're working ...
  • 76
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/...
  • 445k
6 votes
Accepted

Cannot download large files from Salesforce URL using C#

The root cause of your problem is when you try to fetch image data from /sfc/servlet.shepherd/document/download/{ContentDocumentId} resource, you receive the next response, and only after that a ...
5 votes
Accepted

OAuth implementation in SOAP API (C#)

I recently had some challenges adding a SOAP Header when creating a Universal Windows Platform (UWP) application in .NET against the SOAP based APIs. The problem was that the WCF tooling for ...
5 votes

Bulk API v2 Get Job Status Failing - InvalidBatch : Field name not found

Problem resolved! { "operation": "insert", "createdDate": "2019-03-28T19:40:38.000+0000", "systemModstamp": "2019-03-28T19:41:34.000+0000", "state": "JobComplete", "...
  • 111
5 votes

Apex Code - Region for as C#

Expanding on David's answer with an example. In VSCode, you start the folding region with //#region and end it with //#endregion. public static void createAccounts(Integer amount) { List<...
4 votes
Accepted

WSDL: getting the SaveResult in .NET for successful and failed records

If you just want all the results in a single variable you could create a List and use the addRange method. List<SaveResult> allSavedResults = new List<SaveResult>(); allSavedResults....
  • 9,607
4 votes

Request was made to the incorrect endpoint

I believe the endpoints have changed. I can't post more than two links, but I had to use https://webservice.s6.exacttarget.com/etframework.wsdl on an s6 instance. If any of the endpoints in Kelly J ...
  • 161
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

Determine if instance has Multi-Currency Enabled

Another possible way is via UserInfo Class. Boolean multiCurrencyEnabled = UserInfo.isMultiCurrencyOrganization();
4 votes
Accepted

Salesforce Metadata Api/ Tooling Api to build changesets

Yes its possible. But rather than writing the application drom scratch in another language, consider keeping it on platform! You can use the open source Apex Metadata API and custom metadata to ...
  • 394
4 votes

Bulk delete data extension rows

You have to loop and capture the RequestID from the Response to churn through the rows in blocks of 2500. Here's the important part from a PHP implementation: var_dump($results); while ($results-&...
  • 28.3k
4 votes
Accepted

Rest API Save multiple contacts to Task

To enable the feature of associating Tasks with Multiple Contacts in SFDC we enable a feature known as "Shared Activities". This setting can be found in the Activity Settings via Set up Menu . Please ...
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 ...
  • 445k
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.2k
4 votes

How can I encrypt a string in Apex in a way that an external system can decrypt using C#?

The data I would think an external systems developer would need are: The algorithm: AES256. The cipher mode: Cipher Block Chaining (CBC), as documented for the Apex Crypto class. The padding mode: ...
  • 88.2k
3 votes
Accepted

WSDL: Is there a way to get the records that have errors in .NET

create/update/delete/upsert all return a result array that is poisitionally matched against the input array, i.e. if you call update with 5 accounts, a[0] .. a[4], you get back 5 save results, the ...
  • 7,850
3 votes

FIELD_INTEGRITY_EXCEPTION Must specify a nameField of type Text or AutoNumber

TL;DR: cf.typeSpecified = true; Clarifying the question: The other answer mistakenly assumes there is an existing Custom Object and we are getting an error when creating new records for it. The ...
  • 31
3 votes
Accepted

How do I use the SOQL IN keyword in the API? (C#)

Building the where clause as a string in this form (for each ID you have) would work: where Parent_Object_Id__c in ('0035000000nTfXe', '0035000001WH76J', '00350000024hHjG') providing the resulting ...
  • 131k
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, ...

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