salesforce_orm
A NodeJS library for connecting to the Salesforce Enterprise SOAP API and do all operations in a simplified way.
Short "how to use" guide is under construction.
How this library is gonna to help me?
This library is going to manage these things for you:
- Salesforce SOAP API connection and session management.
- Object and query-formatting.
- Response retrieval and parsing.
- Other time-wasting things!
Code Example
Initializing
First step is loading and initializing the library:
let Salesforce = ;let username = 'your@salesforce-user.com';let password = 'yourPassword';let token = 'yourToken';let wsdlPath = __dirname+'/config/production.wsdl.xml'; let salesforce = username password token wsdlPath;
Adding new model
salesforce_orm needs to know with which Salesforce objects are you gonna to work, and which fields are part of that objects, so you will need to add those models following this example:
thissalesforce;
Creating new object instance
Before start creating, updating, or removing records, you need to create a new model instance. The following example shows how to do it:
let newObjectInstance = salesforce;
Also, if you previously have a Javascript object with all record's data, you can create a new instance with these data:
let existentObjectInstance = salesforce; //Here you can pass any model's properties
Retrieve records
existentObjectInstance;
Create records
newObjectInstanceName = 'My awesome new account';newObjectInstance;
Update records
existentObjectInstanceName = ` (edited)`;existentObjectInstance;
Remove records
existentObjectInstance;
Search records
salesforce;