Hot answers tagged

18

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 packageNames parameter on And it really is that simple. I made a test changeset in a sandbox with a single component: Note the "Change Set Name" of TestCS. Then ...


14

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 class Student{ private String firstName; private String lastName; public Student(String firstName, String lastName){ this....


13

Since you are just building a string, you need to wrap the Id in single quotes. SOQL = "select AuthorId,Name, Description,Type from Document where AuthorId='" + id + "'"; As was suggested in a comment, you should also escape any potentially harmful strings found in Id. I'm not familiar with the C# functions, but there should be some sort of URLEscape ...


12

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 falling back to SSL3 (at least when I checked the initial value in a .NET 4.5.1 application). When Salesforce disables SSL3 the fall back option will be ...


11

The Replication API is the most reliable method for data replication. It includes two functions, getUpdated and getDeleted; the former describes newly created and updated records, while the latter indicates records that have been deleted. You can use this API to accurately replicate data in your remote system without worrying about determining specific ...


9

There are a couple ways you can do this in Apex: UserInfo.isCurrentUserLicensed(namespace) from the UserInfo class, which will allow you to determine if the package is installed and the current user has a licensed "seat". Also: if (Type.forName('ns__KnownObjectInPackage__c') != null) {...} which is agnostic to whether the user has a license or not, but ...


7

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://webservice.exacttarget.com/Service.asmx S4 Instance https://webservice.s4.exacttarget.com/Service.asmx S6 Instance https://webservice.s6.exacttarget.com/Service.asmx ...


7

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 a static variable so it can be initialized just once per transaction.


7

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


7

#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 directives aren't understood by the Apex compiler but by the Visual Studio Code editor.


7

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 you can: Generate private key: final Blob privateKey = Crypto.generateAesKey(256); Store somewhere the generated key as a String: // System.debug(LoggingLevel....


6

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.query_all(my_SOQL_query). After running sf.query_all(my_SOQL_query), all 3,860 of my records were returned. (I previously instantiated Salesforce from the ...


6

The BCC functionality needs to be enabled on your account first. Talk to your account rep for details. You can see the note about it on the bottom of this page: http://help.exacttarget.com/en-US/technical_library/web_service_guide/objects/triggeredsenddefinition/


6

Add the ProgramID to the Properties list when making the retrieve. The Automation object has a few issues with it.


6

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 on it constantly!). Hope this (and Chimera) helps! Just as a heads up, automated web scanners like what Chimera use aren't always that useful on API-only ...


6

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/Product2/ProductID__c/%23%20H6%20SHORT%20BARREL%20NUT Characters other than A-Z, 0-9, #, and _ need to be URL-encoded. As it was, the URL was written in a way that ...


5

Resetting Values to null To reset a field value to null, you add the field name to the fieldsToNull array in the sObject. You cannot set required fields (nillable is false) to null. Source: https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_update.htm


5

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 importing WSDLs in UWP apps doesn't automatically generate the SOAP Header classes. You need to create your own header by implementing System.ServiceModel.Channels....


4

Looking at the request in Fiddler, I noticed that the headers and body that I set using RestSharp with the code above were not being set. After some experimentation and research, the following code ended up working: public AuthToken GetAuthToken(string code) { var client = new RestClient("https://login.salesforce.com/services/oauth2/token"); var ...


4

Here's an example: http://wiki.developerforce.com/page/Consuming_Force.com_SOAP_and_REST_Web_Services_from_.NET_Applications Tip: here's how to check for success and call synchronously. Just add ".Result" to the end of the call //call endpoint sync HttpResponseMessage response = httpClient.SendAsync(request).Result; ...


4

Try the following: String queryString = 'SELECT Id FROM ts2__Application__c WHERE ts2__Job__c = ' + ssSearchesId + ' AND ts2__Client__c = ' + ssContactId + ' LIMIT 1'; List <ts2__Application__c> ts2Applications = Database.query(queryString); if (ts2Applications.size() > 0) { ts2__Application__c ts2Application = ts2Applications[0]; ...


4

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 Andrews' answer don't work, try changing the Service.asmx to etframework.wsdl


4

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.addRange(SfdcBinding.update(oppList.ToArray())); allSavedResults.addRange(SfdcBinding.update(pHUpdateList.ToArray())); allSavedResults.addRange(SfdcBinding. create(...


4

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 Id = response.Id; Your example code worked in the past, but when you take a look at THIS COMMIT, you'll see that - thanks to wadewegner - the return type of ...


4

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 define and push change sets. Here is a blog post by Andy Fawcett detailing the process: http://andyinthecloud.com/2015/06/28/custom-metadata-custom-uis-packaging-...


4

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->OverallStatus=="MoreDataAvailable") { $rr = new ExactTarget_RetrieveRequest(); $rr->ContinueRequest = $results->RequestID; $rrm = new ...


4

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 check below screenshot .The last checkbox "Allow Users To Related Multiple Contacts To Events and Tasks"should be checked Once you enable that ,you should be ...


4

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 to the specified endpoint. The message includes a session ID so you can call the API while processing the message.


4

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 between systems. (Emphasis mine). The allowable clock skew grants your system a bit of leeway to utilize the token if its own clock is running behind the server's,...


4

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: PKCS7 (same link). The fact that you are using a managed initialization vector. The fact they you're transmitting the data in Base64. And of course, the key. ...


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