Skip to content

Commit

Permalink
fix sf_fields_description
Browse files Browse the repository at this point in the history
  • Loading branch information
keyn4 committed Jul 3, 2024
1 parent 6d7a568 commit 7be1e5c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions target_salesforce_v3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,29 +236,28 @@ def sf_fields(self, object_type=None):

def sf_fields_description(self, object_type=None, object_fields=None):
if not object_fields:
fld = self.sf_fields(object_type=object_type)
fld = object_fields
object_fields = self.sf_fields(object_type=object_type)

fields = {}
fields["createable"] = [
f["name"] for f in fld if f["createable"] and not f["custom"]
f["name"] for f in object_fields if f["createable"] and not f["custom"]
]
fields["custom"] = [
f["name"] for f in fld if f["custom"]
f["name"] for f in object_fields if f["custom"]
]
fields["createable_not_default"] = [
f["name"]
for f in fld
for f in object_fields
if f["createable"] and not f["defaultedOnCreate"] and not f["custom"]
]
fields["required"] = [
f["name"]
for f in fld
for f in object_fields
if not f["nillable"] and f["createable"] and not f["defaultedOnCreate"]
]
fields["external_ids"] = [f["name"] for f in fld if f["externalId"]]
fields["external_ids"] = [f["name"] for f in object_fields if f["externalId"]]
fields["pickable"] = {}
for field in fld:
for field in object_fields:
if field["picklistValues"]:
fields["pickable"][field["name"]] = [
p["label"] for p in field["picklistValues"] if p["active"]
Expand Down

0 comments on commit 7be1e5c

Please sign in to comment.