Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Bulk API notes. #717

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

renatoliveira
Copy link

I thought of adding these Bulk API notes to help anyone who might be struggling a bit with the sf.bulk. methods of the library. In this text I write about a common error ("InvalidBatch") and how to check the data before sending it over to Salesforce, and also add some tips on preparing the data's date/time columns and relationship fields.

Exception Code "InvalidBatch" with message "Records not processed"
==================================================================

When processing your Bulk API request, one of the first chings Salesforce does is to check the schema of your payload. If the schema is not correct, you will get an error message with the exception code "InvalidBatch" and the message "Records not processed".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misspelling: "chings"

Copy link

@mattmartin26 mattmartin26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overally, VERY needed addition to the documentation!! Please approve this PR.


my_dataframe['Account__r'] = my_dataframe['Account__r'].apply(lambda x: {'AccountNumber': x})

This will convert the `Account__r` column to a dictionary with the external id field that you are using to look up the Account object. This is because of the way relationships work in Salesforce. If you are somewhat familiar with how the platform's database works, you will notice that for the row that is going to be inserted the column that references the lookup object is transformed to an object, in a similar way that in Apex you use the relationship field to access the fields of the related object. This works for standard objects as well, where instead of *ContactId* you would use just *Contact*.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finding this sentence just a bit unclear. Unsure how to suggest an improvement but for someone unexperienced in Apex its hard to envision what being 'transformed to an object' means.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes to this PR so that the spelling is fixed and this part is a little better explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants