Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Releases: OpenFn/language-salesforce

bulk can return noOp with empty array

07 Jul 06:59
Compare
Choose a tag to compare

Pass the allowNoOp: true option to bulk, and it will skip attempting to perform a bulk operation if your function returns an empty array of records to operate on.

bulk('Financial__c', 'upsert', { extIdField: 'Unique_ID__c', failOnError: true, allowNoOp: true }, state => {
  return [];
});
// The above will result in:
// $ No items in Financial__c array. Skipping bulk upsert operation.

SOQL Queries and Bulk API operations

05 Jul 16:42
Compare
Choose a tag to compare

The result of the SOQL query gets put into references[0], just like the other Salesforce responses. It can then be used for later operations in the same job.

query(`SELECT Id FROM Patient__c WHERE Health_ID__c = '${state.data.field1}'`);

Add the failOnError option to a bulk operation if you want the job to be marked as a failure if any of the individual record actions fails.

bulk('Patient__c', 'insert', { failOnError: true }, state => {
  return state.data.someArray.map(item => {
    return { 'Age__c': item.age, 'Name': item.name }
  })
});

humanProper

19 Feb 21:37
Compare
Choose a tag to compare

import humanProper from language-common for converting underscored lower case text like this_text_here to proper-cased and spaced text like This Text Here.

documentation updated

07 Sep 19:36
Compare
Choose a tag to compare

state is passed in automatically by execute and expandReferences

documentation!

07 Sep 19:08
Compare
Choose a tag to compare
v0.5.0

bump version to 0.5.0

Conditional create and upsert

22 Feb 21:56
Compare
Choose a tag to compare

createIf(logical, object, fields)
upsertIf(logical, object, externalId, fields)

added `update(...)` function

23 Nov 16:57
Compare
Choose a tag to compare
v0.3.0

added update(...) function in v0.3.0

added alterState from language-common

20 Sep 09:45
Compare
Choose a tag to compare

v0.1.6

08 Sep 09:34
Compare
Choose a tag to compare

build.tgz updated to include ast.json for new openfn front-end.
no changes were made to lib