Hot answers tagged

12

You cannot use other programming languages for backend development but have in mind that within Salesforce you can use a great number of APIs, from which the most popular ones for developing custom applications are REST API and SOAP API. For mobile development you can use Mobile SDK. Also, Salesforce frontend development is basically a JavaScript. The ...


10

No. All server-side code must be written in Apex.


7

Good timing, the version 1.0.0 was released 4 days back and seems to have resolved some of the issues you pointed out. You need to be using Suds-jurko 0.6 I can confirm most of the basic FuelSDK operations seem to be working okay with Python 3.x


5

Refer to Set up Authorization: Once authenticated, every request must pass in the access_token value in the header. It cannot be passed as a request parameter. Parse for access_token in request.content. Then use it in Authorization header: import json, requests #... body = json.loads(r.content) token = body["access_token"] url = body["instance_url"] + "/...


5

The ERROR Errno::12 Not enough space is a generic error which appears when your Java/ Ruby apps run out of memory. I'd recommend checking If your host/ VM has run out of memory while executing your program If your sessions are never getting expired or killed or there's something else which is hogging memory and not releasing it Check if you are using the ...


5

Ok fortunately We were able to figure it out. In summary the answer to my question is YES. First: From the App Center We created an App and linked it to the Parent Business Unit. Then used the clientId and clientSecret that was generated. Second: We found that FuelSDK-Python Source code did not support retrieving from sub business units/accounts, even ...


5

Shortly(Dev preview feb 2020) we will get Evergreen function that will allow you to write nodejs and Java code in Salesforce org. https://developer.salesforce.com/blogs/2019/11/introducing-salesforce-evergreen.html Given that Salesforce has acquired Heroku few years back, there is a strong possibility that you might get Python. Safe harbor ofc.


4

I solved this by ensuring that the cookies returned in the handshake response were included in all other requests.


4

It is indeed supported. The correct URL is /interaction/v1/interactions/{id} There was a bug in the official documentation which should now be fixed. Refer this thread for more details.


4

You have a typo in your endpoint. Try changing your endpoint from https://www.extracttargetapis.com/asset/v1/content/assets to https://www.exacttargetapis.com/asset/v1/content/assets


4

You need to send the clientId and clientSecret as the body of the POST not as an auth header like: { "clientId": "gyjzvytv7ukqtfn3x2qdyfsn", "clientSecret": "************" } or a data key value pair like: data = {'clientId':'value'}


4

You cannot directly execute Apex Code purely using the REST API. The two means for executing code directly are Web Services (SOAP API) and Execute Anonymous (Tooling API). You could modify the Simple Salesforce library to use either of these techniques, but you'll need to write your own code to get this to happen. Using the Tooling API would arguably be ...


4

I'm the author of aiosfstream. Thanks for notifying me about this question! tl;dr You can use aiosfstream to subscribe and listen for platform events, but you can't use it for publishing. To publish platform events you have to use one of the documented methods. Since you're trying to publish events from a python application, publishing events with the ...


4

You need it to be a String whose content is wrapped in single quotes ('...'). This approach should work: to_this = "'Jones'"


4

That's just how the Salesforce API returns cross-relationship data (as unpacked into OrderedDict structures in Python). It looks like you tried to get the property X__Region__c from the top-level object that you queried, because the content you're seeing here: OrderedDict([(u'attributes', OrderedDict([(u'type', u'X__Region__c), (u'url', u'/services/data/...


3

There are multiple ways to achieve this. 1) What you can do is create your custom web service and call your batch job in your web service. Once your web service is set up then you can call it from Python (or any where is the world) Here is link that will tell you how to create custom web service in SFDC. SOAP web service: https://developer.salesforce....


3

Explore Event Relationship object of salesforce . https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_eventattendee.htm You can create an Event relationship in salesforce and attach the contact Id if it exists in sfdc EventRelation er = new EventRelation(EventId = '00UD0000005zijH', RelationId = '003D000000Q8aeV', isParent = ...


3

There is missed the "'Body' : body " parameter in json.dumps object. the 'body' value in the dictionary should be the base64 encoded contents of the file which is missed. you need to read and encode the file contents yourself. It should be like this: data = json.dumps({ 'Description':'Information', 'Keywords':'Information', 'FolderId': '...


3

You are trying to run Update on ApexTrigger via Metadata API. According to the documentation: This metadata type is not supported by the create(), delete(), and update() calls. In order to update a trigger via Metadata API you need to use a file based call: deploy() FYI - Metadata update() call is deprecated. You should not be using it for anything, ...


3

To my knowledge, there's not a Python library that works with the newer versions of the MDAPI. I hacked together a very basic integration by manually generating the SOAP envelopes for some MDAPI methods including deploy along with some python classes to provide an easy wrapper you can call from other python code. https://github.com/SalesforceFoundation/...


3

I had a similar issue awhile back retrieving different tracking events and was able to resolve it by creating a complex filter with more filtering criteria such as a SendID or ClientID (MID), along with the date filter. A complex filter can be 2 simple filters combined with an operator. I created some example code but am unable to test at the moment, ...


3

You posted in your code that you are setting the value of refresh_token to refresh_token. It needs to be the refresh token you got in the access token response (5Aep861HDR3iASSX_protected_JIgHyRWn.6oH6XKva0f76V5AxRE7YhZygZQg). not sure if you replaced the actual refresh token with the words "refresh_token" but since you had no problem posting it later in ...


3

Instead of: .format(today, 'Renewal') Use: .format('today', '\'Renewal\'') You want your first argument to be a Date Literal, and the second argument to get merged in as a literal string. That way your filters would read: WHERE CloseDate = today AND Type != 'Renewal'


3

you have to explicitly send a String of the query to SOQL from python, replace variable binding with concrete values and concatenations of string ict = sf.query("SELECT Id,FirstName,LastName,Email FROM Contact WHERE Id='" + cid + "'") This is exactly the same, as Dynamic SOQL in Apex


3

The standard CLI commands accept a --json flag which returns JSON (and seems to include a status code).


2

I think you need to call client._setEndpoint(serverUrl) The Partner API Server URL should be of the form https://{instance_url}/services/Soap/u/{version}/{orgid} For example https://na1.salesforce.com/services/Soap/u/31.0/00D50000000IZ3Z If you've done OAuth, you can easily obtain the Partner API Server URL by calling the Identity Service. Append ?...


2

Here's a script I've written that downloads Salesforce Attachments and Documents: https://github.com/ekenigsberg/sfpy-fileexport-soap It's adapted from an earlier (non-python) Windows script I wrote: http://bit.ly/aboutfileexporter


2

Found an answer, sort of, as of Feb 12, 2018. When you're using Lightning Experience, the system notifications use CometD, which conflicts with any other implementation of CometD -- killing your connection. The workaround is to go to Setup>Apps>Mobile Apps>Salesforce Notifications and uncheck both boxes there. That now means anyone using the Mobile app for ...


2

This sounds like an issue purely on the Python side. It's one I've run into in some form or another many times in Python whether or not I was working with Salesforce data (usually via simple-salesforce which is wonderful). I think what you want to do is wrap in unicode() rather than str().


2

This looks like a Python object returned by the suds package, which is what the Fuel-SDK uses to make SOAP requests. If the code snippet you posted is what is stored in response.Results, you should be able to access the values like this: for send in response.Results: print send.SendDate Or like this: print response.Results[0].SendDate If you want ...


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