Skip to content

Instantly share code, notes, and snippets.

@pramodya1994
Created December 17, 2019 15:13
Show Gist options
  • Save pramodya1994/9dafcb68d73864c01c4e9ea5df57e6b1 to your computer and use it in GitHub Desktop.
Save pramodya1994/9dafcb68d73864c01c4e9ea5df57e6b1 to your computer and use it in GitHub Desktop.
public function main() returns error? {
// Create salesforce bulk client.
sfdc46:SalesforceBulkClient sfBulkClient = salesforceClient->createSalesforceBulkClient();
// Create CSV insert operator.
sfdc46:CsvInsertOperator csvInserter = check sfBulkClient->createCsvInsertOperator("Contact");
// Read CSV file content.
io:ReadableByteChannel contacts = check io:openReadableFile("sfdc contacts - sheet1.csv");
// Import csv contacts to Salesforce.
sfdc46:BatchInfo batch = check csvInserter->insert(<@untainted> contacts);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment