Created
October 16, 2023 19:06
-
-
Save Ed1123/91d848ee758a50c471f45f497a40f119 to your computer and use it in GitHub Desktop.
Simple funciton to connect to Salesforce (and sandbox when needed)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect_salesforce(username: str, password: str, security_token: str, is_test: bool) -> Salesforce: | |
'''Returns a Salesforce connection object. If test, it'll connect to Sf sandbox''' | |
domain = None | |
if is_test: | |
domain = 'test' | |
username += '.full' | |
return Salesforce(username, password, security_token, domain=domain) | |
sf = connect_salesforce(username, password, security_token, False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment