Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import * as jsforce from "jsforce";
  2.  
  3. var conn = new jsforce.Connection({
  4.  
  5. loginUrl : 'https://login.salesforce.com'
  6. });
  7. var username = 'XXXXXXXXXXXXXX';
  8. var password = 'XXXXXXXXXXXXXXXXXXXXXX';
  9. conn.login(username, password, function(err, userInfo) {
  10. if (err) { return console.error(err); }
  11.  
  12. console.log(conn.accessToken);
  13. console.log(conn.instanceUrl);
  14. // logged in user property
  15. console.log("User ID: " + userInfo.id);
  16. console.log("Org ID: " + userInfo.organizationId);
  17.  
  18. });
  19. // this part of code doesn't seem to work
  20.  
  21. conn.streaming.topic("InvoiceStatementUpdates").subscribe(function(message) {
  22. console.log('Event Type : ' + message.event.type);
  23. console.log('Event Created : ' + message.event.createdDate);
  24. console.log('Object Id : ' + message.sobject.Id);
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement