Hot answers tagged

11 votes
Accepted

GROUP BY custom field

Yes it's possible to group by custom fields in general, but not all field types are groupable. The docs aren't particularly helpful from what I can see, and just tell you a field is groupable if it'...
user avatar
9 votes
Accepted

Handle JSON array from REST call

You have an array of objects, so you should use: List<SalesData> resultList = (list<SalesData>) JSON.deserializeStrict( response.getBody(), List<SalesData>....
user avatar
  • 434k
8 votes

How can I install GMagick on Heroku?

Are you trying to install the graphicsmagick library? If so, you might want to check out this buildpack: https://elements.heroku.com/buildpacks/xerpa/heroku-buildpack-graphicsmagick Also, if you ...
user avatar
7 votes
Accepted

Salesforce - business logic - best practices

I hear you using the term "business logic", yet you're also talking about connectivity API's to talk with external Databases. In SF language, that's normally referred to as "technical architecting". ...
user avatar
  • 40.4k
6 votes
Accepted

Fuel SDK + PHP + Sendable Data Extension

The key seems to be two-fold - Adding a (NULL) value attribute to the SendableDataExtensionField and SendableSubscriberField objects Despite the documentation stating that the ...
user avatar
  • 109
5 votes
Accepted

Force.com Toolkit for PHP - Still Officially Supported?

If you don't need the new > v20.0 features, you can still use it verbatim for some time. It really isn't much more than a wrapper for things you'd do yourself if you used SoapClient (I've done this ...
user avatar
  • 434k
5 votes
Accepted

What is the maximum number of records I can send per RESTful API call?

If you are using the standard endpoints, such as POST /vXX.X/sobjects/Account or PATCH /vXX.X/sobjects/Account/id, then yes, you can only create or update one at a time. The bulk API, or even the ...
user avatar
  • 239
5 votes
Accepted

Connect an apex trigger to an authorized user's account

Expanding my comment into an answer. I'd suggest you considered using the new Change Data Capture feature instead. Synchronization of Salesforce data to an external persistent store is exactly what ...
user avatar
  • 87k
4 votes

PHP API Triggered Send

Take a look at this example of TriggeredSend for the PHP Fuel SDK? This explains how you can set the subscribers while sending a triggered send.
user avatar
4 votes

What is the maximum number of records I can send per RESTful API call?

Using "patch", the limit is 1. That's because this API is really intended for mobile devices, of which you'll usually be working with one record at a time. Also, it's considered the RESTful design, ...
user avatar
  • 434k
4 votes
Accepted

Get more than 2000 with SOAP and PHP

The SOAP API can return up to 2000 records at a time. If there are more records, then you will also be returned a QueryLocator which you can then use to do QueryMore call. You need to repeat the ...
user avatar
4 votes
Accepted

Trigger Welcome Email after adding new subscriber via API?

I would set up a new Triggered Send definition in the account and then call it manually using either the SOAP or REST API's. Populate the Triggered Send request with the info of the new subscriber you ...
user avatar
  • 1,958
4 votes
Accepted

PHP API - Unable to query fields in custom objects

Use the partner WSDL. Please note that you have to put this to URL like http://yourServer/yourPartnerWsdl.xml - it won't work using a local path like /var/www/whatever/yourPartnerWsdl.xml You will ...
user avatar
  • 33.6k
4 votes

(400) - Bad Request when requesting auth token using Wordpress

So I got it working. I had to change the Content-Type header to application/x-www-form-urlencoded, which I tried because of this answer. Unfortunately the docs don't tell you that. In fact they say ...
user avatar
  • 71
4 votes

How to insert/pass NULL value into Date field

You need to use the fieldsToNull attribute, as noted in the update documentation. $createField["fieldsToNull"] = array("Date__c");
user avatar
  • 434k
4 votes
Accepted

REST API - PHP - Salesforce- Update Account owner byName

if you know new OwnerId, just assign it to new variable $someOwnerId and put as key to map. $content = json_encode(array("Name" => $new_name, "BillingCity" => $city, "OwnerId" => $...
user avatar
3 votes

Decrypt a string encrypted by the EncryptSymmetric() AMPscript function using PHP

I had the same question and thanks to the great work of @Kolohe with the mcrypt example I found a solution with openssl_decrypt and DES encryption. With the upgrade to php7 we replaced mcrypt with ...
user avatar
  • 31
3 votes

Salesforce Open Popup via Trigger

After the lead is inserted via the API you can retrieve the resulting record Id. This is after all the triggers have completed and control has returned to your PHP code. Then in your PHP code you can ...
user avatar
3 votes

Fuel SDK + PHP + Sendable Data Extension

Those fields are expecting an object, not a string, so please change the following lines: "SendableDataExtensionField" => "EmailAddress", "SendableSubscriberField" => "EmailAddress" to look ...
user avatar
3 votes

Create a TriggeredSend Definition Fatal error: Call to undefined method WSSESoap::addOAuth() in /ET_Client.php on line 165

Turns out I was using a different version of soap-wsse.php. The version in the Fuel package has an added addOauth method that the version I had didn't. I replaced it with the new one, and all is fine.
user avatar
3 votes

Trying to figure out how to update values in subscribers attributes using php fuel sdk

function t_user_registration_messaging_profile_form_submit($form, &$form_state) { global $user; require('FuelSDK-PHP-Dot9/ET_Client.php'); $myclient = new ET_Client(true); $subscriber = ...
user avatar
  • 41
3 votes
Accepted

Date format with Salesforce REST API

According to the documentation here http://php.net/manual/en/datetime.createfromformat.php you can try this <?php $value = "2014-11-20T14:23:44.000+0000"; // example value $value = substr($...
user avatar
  • 152
3 votes
Accepted

Adding new values to Custom Picklist (PHP Toolkit)

From what I can see you're using the metadata API to create/update fields, which is not supported via that API. In cases where you need to interact with your org's objects, apex classes etc. ...
user avatar
3 votes
Accepted

How to update a send definition using exact target's api

Just change the list ID in this sample packet: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <...
user avatar
  • 3,197
3 votes
Accepted

Is there anyway to delete a SF object record using the PHP toolkit?

You do have delete method as part of the Standard Salesforce API and also included in the PHP toolkit. you need to pass in the list / array of record ids to be deleted.. $deleteResult = $...
user avatar
3 votes
Accepted

Modifying data using SOQL?

See the various examples in Getting Started with the Force.com Toolkit for PHP. You use SOQL to query: $query = "SELECT Id, FirstName, LastName, Phone from Contact"; $response = $mySforceConnection-&...
user avatar
  • 130k
3 votes
Accepted

Creating Case via PHPToolkit fails to activate email queue

You need to specify the EmailHeader in order to trigger emails (it defaults to false). This will cause the system to send out any notifications it would normally.
user avatar
  • 434k
3 votes
Accepted

The Triggered Send is not completely configured or in a new status

For Triggered Send emails, I would recommend against creating a new TriggeredSend for each email that is sent. A TriggeredSend should be created once to represent the campaign or specific type of ...
user avatar
  • 2,422
3 votes

session id or oath token, they not interchangeable?

Session Id values and Authorization tokens are indeed interchangeable. In fact, I often use Session Id values instead of a token when I'm mocking a quick JavaScript function in my browser. For example:...
user avatar
  • 434k
3 votes
Accepted

SOAP API username and password

If you are using SOAP API for login functionality ,please note that the Username and Password are your user credentials . Also kindly note that password here is a combination of Password + Security ...
user avatar

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