-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
64 lines (45 loc) · 1.16 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import logging
import pprint
import sys
from simple_salesforce import Salesforce
from mdapi_update_object import update_object
from mdapi_update_permission_set import update_permission_set
from update_records import update
from utils import salesforce_login as login
logging.basicConfig(format="%(asctime)s : %(message)s", level=logging.ERROR)
#
# sf_credentials = (
# "<instance_url>",
# "<session_id>",
# )
#
sf_credentials = (
"",
"",
)
custom_field_name = "Archive_Id"
def main(sf: Salesforce):
try:
print("\n*** Update Objects ***\n")
update_object(sf)
except Exception as e:
pprint.pprint(e)
# sys.exit(1)
try:
print("\n*** Update Permission Set ***\n")
update_permission_set(sf)
except Exception as e:
pprint.pprint(e)
sys.exit(1)
try:
print("\n*** Update Records ***\n")
update(sf)
except Exception as e:
pprint.pprint(e)
if __name__ == "__main__":
sf = login(sf_credentials)
if not sf:
print("\n*** Not Logged into Salesforce ***\n")
sys.exit(1)
print("\n*** Logged into Salesforce ***\n")
main(sf)