Skip to content

How to catch error while inserting data to salesforce using salesforce bulk lib. #118

@Patiladi778

Description

@Patiladi778

Hi all, I am Inserting a data into salesforce workbench using salesforce bulk lib.
MY code -
job = bulk.create_insert_job("Account", contentType='CSV',concurrency='Parallel')

csv_iter = CsvDictsAdapter(iter(list_of_dicts))
try:
batch = bulk.post_batch(job, csv_iter)
bulk.wait_for_batch(job, batch)
bulk.close_job(job)
except Exception as e:
print('error while inserting to salesforce ',e)

I have a data type miss match between source and target location, but I am unable to log the error.
Suppose the batch has 100 correct and 10 wrong records will the lib insert 100 records or will not insert any data.

@sr @kennyp @VoidLock @jmalonzo Could you please help me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions