Questions tagged [simple-salesforce]

simple-salesforce is a basic Salesforce.com REST API client built for Python 2.6, 2.7, 3.3, 3.4, 3.5, and 3.6.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How to get field level permission of any specific profile using metadata api with simple_salesforce [duplicate]

I'm working in Python with the simple_salesforce library. I am not able to get field-level permission using metadata API (without using a query).
Prime's user avatar
  • 11
0 votes
1 answer
49 views

Extended Response Time with simple_salesforce Library's upsert method

Problem Statement: I'm encountering prolonged response times exceeding 30 seconds while using the simple_salesforce library to perform upsert operations in batches using the bulk functionality. The ...
Mahesh Patil's user avatar
0 votes
1 answer
32 views

Get a mapping of External Ids and Salesforce Ids when migrating data from simple-salesforce

I want to migrate Account data into Salesforce and create a lookup table containing Salesforce IDs and External IDs. I am using the simple-salesforce library to perform a bulk insert of Accounts into ...
Aayush Mishra's user avatar
0 votes
0 answers
117 views

Why is my SESSION_ID invalid immediately after authenticating my JWT token?

So I am trying to get simplesalesforce working in a dev account for proof of concept (and, so far, I've been making a proper mess of it). I have FINALLY managed to successfully connect using a JWT ...
jesse's user avatar
  • 121
2 votes
1 answer
193 views

How Do I Use OAuth2.0 With JWT To Connect To Salesforce?

So I'm trying to get a proof-of-concept together so I can ask my employer for access to our Salesforce (I'm a new employee and very low on the food chain, but their current workflow is just STUPID). I'...
jesse's user avatar
  • 121
0 votes
0 answers
96 views

Unable to retrieve the error records with error details from Salesforce using simple-salesforce

I am using the simple Salesforce Python library to load data from S3 to Salesforce using Databricks. I am leveraging the bulk API for the data load process. However, when attempting to insert data ...
SK ASIF ALI's user avatar
0 votes
0 answers
426 views

"The Single Sign-On Gateway Url is invalid" error when making API calls

I'm testing API calls to Salesforce via Connected Apps in an environment where SSO is enforced via Permission sets. For the SSO I'm federating using Facebook. The communication works fine without SSO (...
user777's user avatar
0 votes
0 answers
78 views

Salesforce permissions not creating correctly using simple-salesforce

I am trying to create a permission set, object permissions for that permission set and field permissions for that permission set. However, the permission set is created correctly but the permissions ...
Paul Bradbury's user avatar
1 vote
0 answers
37 views

unable to remove login ip range using mdapi with simple_salesforce

I am able to get the profile login range ip, set it to what I want but when I try to update the profile I get many error messages. sf = Salesforce(username='[email protected]', password='...
Json's user avatar
  • 1,587
0 votes
1 answer
188 views

How to set field level security on new field with simple_salesforce

I'm working in Python with the simple_salesforce library. I can create new fields on my Account and Contact objects, based on info in How to update object description using simple_salesforce. ...
David Goldfarb's user avatar
1 vote
0 answers
120 views

Download a large Salesforce Report using Python simple_salesforce

I am trying to download a large Salesforce Report using Python that has around 300k rows. It seems that because the report is so big the code executes but does not populate the data. Is there a way to ...
Alexander Von Schwerdtner's user avatar
0 votes
0 answers
84 views

How to decode validFor for dependent picklists in Python?

According to this question, validFor="AAAI"should translate to 000000 000000 000000 001000. With the following function I get 10000010100000101000001010010010 however. What is the problem? ...
Corram's user avatar
  • 123
0 votes
0 answers
163 views

I am not able to update records in my custom object using the api name Validate_Contact__c

I am not able to update records in the custom field Validate_LinkendIn_Title of my custom object Validate_Contact from the dataframe df_final. The error SalesforceResourceNotFound: Resource ...
Tejas 's user avatar
0 votes
0 answers
172 views

Unable to add CustomField to CustomObject Python API Simple Salesforce

When trying to UPDATE CustomObject with newly added custom field, I get this error message: TestCustomObject__c.AccountNumber_NEW__c: (INVALID_CROSS_REFERENCE_KEY, In field: fullName - no CustomField ...
JanB94's user avatar
  • 11
0 votes
1 answer
509 views

Simple-Salesforce: is there a way to bulk insert data on a lookup field without an external ID?

I previously posted this question: Simple-salesforce: perform a bulk insert on a lookup field In that thread I got the documentation answer for how to perform an update based on an external ID. In the ...
Tyler Davis's user avatar
0 votes
1 answer
838 views

Simple-salesforce: perform a bulk insert on a lookup field

I am attempting to perform a bulk insert to a custom object in salesforce using the simple-salesforce library. I have a lookup field with a the api endpoint 'Account_Name__c', along with a few others. ...
Tyler Davis's user avatar
0 votes
1 answer
453 views

simple-salesforce: perform a bulk query on a custom object

I have seen examples of how to perform a bulk query on a standard object like this: sf.bulk.Opportunity.query( "SELECT Id, Account.Name, Name, RecordType.Name, Type WHERE Id = 12345") I ...
Tyler Davis's user avatar
0 votes
1 answer
2k views

How do I bulk update records using simple-salesforce?

I am successfully performing a bulk query operation using simple salesforce to obtain the Id's I want to work with, but when I perform a bulk update like this: data=[{'Id': '1', 'Date__c': '12/01/2022'...
Tyler Davis's user avatar
0 votes
0 answers
320 views

Scratch org: call REST APIs via simple_salesforce

I have a very simple python 3.x script that is getting errors when attempting to connect. So far, it simply consists of: from simple_salesforce import Salesforce import pandas as pd sf = Salesforce(...
lengthy_preamble's user avatar
0 votes
0 answers
339 views

Json Deserialization failed on token and has left off in the middle of parsing a row

I am trying to bulk load a csv file with 11000 records using Python with the simple-salesforce API. The error that I am running into is that when I try to load the file, I get this message: {'created':...
Perdue's user avatar
  • 121
-1 votes
1 answer
353 views

Redirect Error with Simple Salesforces and Requests

I have a python script that pulls specific reports out of Salesforce everyday. However recently the script started returning the error requests.exceptions.TooManyRedirects: Exceeded 30 redirects. ...
Generic_User's user avatar
1 vote
1 answer
279 views

Encoding and Decoding Base64 Python / Salesforce

I’m working on a small python script to export ContentVersion records from one Salesforce org and migrate them into another. I’m using simple-salesforce. I am able to export the ContentVersion and the ...
Andrew Cann's user avatar
1 vote
0 answers
262 views

Simple Salesforce how to create Custom Big Object?

Is there a way to create Custom Big Object with the simple salesforce metadata API? This is my approach: idx_field = mdapi.IndexField( name="MY_ACCOUNT_ID__c", sortDirection=&...
JanB94's user avatar
  • 11
0 votes
1 answer
240 views

Changing Case Owner in With sharing class

I have few question on "with Sharing" and "without Sharing" keyword in apex, In my Org the OWD for case is Public read only. I have one class where i am updating owner id of the ...
Nitish Yadav's user avatar
1 vote
0 answers
79 views

Encode/Decode ContentVersion Rest API Export and Upload [duplicate]

I’m working on a small python script to export ContentVersion records from one Salesforce org and migrate them into another. I’m using simple-salesforce. I am able to export the ContentVersion and the ...
Andrew Cann's user avatar
0 votes
1 answer
176 views

How to fetch validation rules with Python's simple_salesforce?

I want to do something like from simple_salesforce import Salesforce, format_soql sf = Salesforce(username=..., password=..., security_token=..., domain=...) result = sf.query(format_soql("...
Corram's user avatar
  • 123
0 votes
1 answer
6k views

SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]

Following details I gave and try to connect salesforce via simple_salesforce, Salesforce(instance_url = 'https://********.my.salesforce.com', username = '[email protected]', password = '...
KarSho's user avatar
  • 101
0 votes
1 answer
280 views

Filter Case_Created__c, Datetime format issue, Python SOQL

New to SOQL and using python to script SF object pulls. I am pulling from Case and need just when Case_Created__c > 2020-12-31, but am getting a error with the DateTime format issue. For other ...
Erin Keeney's user avatar
0 votes
1 answer
430 views

How can I get key prefixes of each object from a Salesforce Instance with pythons simple_salesforce API?

I want to extract keys for each Salesforce object (including custom) from a Salesforce environment via the simple_salesforce python library. That is, I want a pandas dataframe that looks as follows: ...
Corram's user avatar
  • 123
0 votes
1 answer
730 views

How to update object description using simple_salesforce

I would like to set the description for all object fields that are layoutable but not present in any layout to: "Not used". I found out how to find fields that are layoutable, but I can't ...
ThaNoob's user avatar
  • 149
2 votes
2 answers
530 views

No such column 'Description' on entity 'EntityDefinition'

I'm trying to retrieve object descriptions with the following SQL query: obj_info = pd.DataFrame(sf.query( "SELECT Label, Description FROM EntityDefinition WHERE IsCustomizable=True")...
ThaNoob's user avatar
  • 149
1 vote
1 answer
2k views

Python Simple-Salesforce - Fetch Bulk API Job Id in result

Is there some way to get Bulk API Job Id in job results? object_type = self.sf_connection.bulk.__getattr__('Case') results = objecttype._bulk_operation(use_serial = True, operation = 'delete', data = ...
Sukruti's user avatar
  • 450
1 vote
1 answer
516 views

With simple-salesforce how can i trigger case ownership email?

I am using simple-salesforce to assign a case to an agent from a Queue. If I do this via the application i have the check box that says "send email notification" as pictured below. How can ...
jAC's user avatar
  • 143
3 votes
1 answer
1k views

Create custom field type picklist via tooling rest api - which meta information required?

I want to create a new custom field on a custom object on SalesForce. The custom field type shall be of type 'picklist' (non-global) with a predefined set of values. I want to use the Salesforce ...
HeXor's user avatar
  • 215
0 votes
1 answer
159 views

JSONDecodeError while accessing Salesforce's ContentNote content using simple-salesforce

I am trying to access the content from the contentnote object. I queried ContentDocumentLink where i passed account id as LinkedEntityId and got the ContentDocumentId. Using ContentDocumentId, I ...
sudeep's user avatar
  • 3
1 vote
1 answer
2k views

Dynamically Update and Insert Records using Simple-Salesforce Library

I am using the Python Simple-Salesforce Library for bulk insert and updating records. I want to create one method in which I pass the Sobject API name and then at run time have it insert/update ...
Matthew Metros's user avatar
1 vote
1 answer
1k views

Python Simple-Salesforce - Import related records with an external ID

Some time ago I've started to use Python with Pandas and Simple-Salesforce to make data migration to Salesforce orgs. I want to insert Account records and Contact records that have lookup to Account ...
gcalikpl's user avatar
  • 121
0 votes
1 answer
272 views

How to upload products to opportunity using simple_salesforce

OK, I can be more specific now. Tried now to simply create new opportunity line items, however, I get this error message: esponse content: [{'message': "Error: You can't select products until you'...
Gigi Hofleitner's user avatar
1 vote
1 answer
1k views

Simple Salesforce Query issues involving Malformed requests

I have a malformed query problem when using simple salesforce for my AWS python Lambda. The query uses the AccountContactRelation object. When an event is dropped into an AWS S3 bucket for taxonomy ...
Anthony Williams's user avatar
0 votes
0 answers
21 views

lightning:unsavedChanges not works with console application

lightning:unsavedChanges not works while doing tab switch in console application. It works fine on tab switching in standard application. Any thoughts?
Sainath's user avatar
  • 33
1 vote
1 answer
964 views

Python Simple Salesforce - Upsert to CampaignMembers Object

I am trying to find an automated way to add contacts & leads to existing campaigns by using simple salesforce to upsert records to the CampaignMembers object. I have a CSV file with CampaignId and ...
codr's user avatar
  • 23
0 votes
1 answer
456 views

Execute Anonymous via Simple_Salesforce throwing EOF exception

I'm attempting to execute a simple anonymous Apex script via Python with the simple_salesforce library. from simple_salesforce import Salesforce sf = Salesforce(instance=scratch_org_instance, ...
Nicholas Zozaya's user avatar
1 vote
1 answer
6k views

REST API: Error 'METHOD_NOT_ALLOWED' - PATCH

I am trying to upload new records by calling a REST API but am getting the following error. simple_salesforce.exceptions.SalesforceGeneralError: Error Code 405. Response content: [{'errorCode': '...
codr's user avatar
  • 23
2 votes
1 answer
1k views

Object of type datetime is not JSON serializable

I'm new using Simple_Salesforce for Python and I'm trying to update a record of "Account" and one of the values that I need to update is a Date/Time value, but I'm receiving the error: "...
Abraham Sanchez's user avatar
0 votes
1 answer
115 views

Is there any way to cache the salesforce data using "simple_salesforce" python library

In my python application, I used "simple_salesforce" library to fetch data from salesforce. Instead of hitting an API every time I would expect salesforce to return data from cache instead ...
Pez's user avatar
  • 101
2 votes
1 answer
5k views

Using simple-salesforce with oAuth

I have a need to query salesforce data through a django app. I am currently using simple-salesforce to do this on our QA salesforce using a username, password and a security token. Now that I am ...
jAC's user avatar
  • 143
0 votes
1 answer
471 views

simple_salesforce python how to rewrite this using bind variables

revenue = sf.query("SELECT Id, Name, Net_Revenue__c, Price__c, Credits__c, Gross_Revenue__c, Account__r.Name \ FROM Revenue__c WHERE Account__r.Id = '"+accountId+"' and MonthYear__c ...
Mike JM's user avatar
  • 15
1 vote
1 answer
2k views

Dynamic simple_salesforce query with list of ids

This 2nd format_soql is not working. I have tried replacing the single quotes to double quotes as per the format defined here: https://github.com/simple-salesforce/simple-salesforce#queries query1 = &...
summer's user avatar
  • 118
0 votes
1 answer
222 views

Where can I view attachments that I've uploaded to salesforce using a REST api?

response = requests.post('https://%s.salesforce.com/services/data/v29.0/sobjects/Attachment/' % instance, headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % sessionId },...
Akhil Khanna's user avatar
0 votes
1 answer
1k views

Error Salesforce data query - [{'message': 'INVALID_HEADER_TYPE', 'errorCode': 'INVALID_AUTH_HEADER'}]

I am trying the get data from Salesforce using simple_salesforce python package. But I am getting Response content: [{'message': 'INVALID_HEADER_TYPE', 'errorCode': 'INVALID_AUTH_HEADER'}] when I ...
sudeep's user avatar
  • 3