JSForce Patterns
This is a helper extension for JSForce. This library aims to create reusable and dynamic functionality by abstracting repetitively used methods. Instead of method chaining actions together - enter all your parameters into one method which you can either async/await or still optionally callback.
Installation
npm install jsforce-patterns
Documentation
See docs at: https://github.com/matthewdoles/jsforce-patterns/tree/master/docs
Example
Query for specifc Account record, update record with new random number in Account Name, and verify Account record was updated.
const login findOne updateRecord logout = ; const execute = async { try // Login const conn = await ; // Query console; const record = await ; // Results console; const newAccountName = 'Updated Account #' + Math; console; // Update await ; // Verify console; const updatedRecord = await ; console; // Logout await ; }; ;
Execution:
Login Successful!
Execute Query...
Current Account Name: Updated Account #631
Change Account Name To: Updated Account #768
Execute Query...
Updated Account Name: Updated Account #768
Logout Successful!