2022 Developer Survey is open! Take survey.

Questions tagged [jsforce]

JSforce (f.k.a. Node-Salesforce) is an isomorphic JavaScript Library utilizing Salesforce's API: It works both in the browser and with Node.js

Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

JSForce: upload different fields in same load

Is it possible to upload lots of records, specifying different fields using conn.bulk.load? E.g.: let accounts = []; let account1 = { Name : "Steve", AccountNumber : "123", ...
user avatar
  • 808
0 votes
1 answer
74 views

CPQ JSForce Query

I am working with the CPQ Jvascript Calculator. I writing logic on BeforePriceRules. I will need to do a couple of Queries to get what I need. When I write my first Query the order of Operation of how ...
user avatar
1 vote
1 answer
33 views

How to use jsforce to post to opportunity chatter

I am trying to use jsforce to post a message to the chatter section of a salesforce opportunity. I pieced the following together from watching how salesforce.com works, but it doesn't do what I want ...
user avatar
2 votes
1 answer
133 views

error in node JS and SF integration via jsforce using JWT

Premise: I need to integrate SF with NodeJs using JWT. I'm following Salesforce Developers Session for this purpose. As of now the entire setup of NodeJs is only in local. According to the video I ...
user avatar
  • 405
0 votes
1 answer
179 views

JSforce query call not returning

I'm trying to prove out a basic JSforce library use case in Node.js. I'm able to connect to Salesforce, but for some reason, I'm unable to run a basic query. Node version: v16.13.0 jsforce version: 1....
user avatar
2 votes
1 answer
155 views

jsforce: retrieve metadata of a report with a row-level formula

When I use sfdx to pull a report, I see custom row formula fields under customDetailFormulas, but when I pull the same report using jsforce, customDetailFormulas are missing and the row summary ...
user avatar
  • 99
0 votes
0 answers
24 views

Logout from Salesforce org when logged out from connected app [duplicate]

I am building a nodejs application using Express and JSforce libraries. I am using a connected app in SF for authentication using oauth2.0. So when I login to my nodejs application, it redirects to ...
user avatar
0 votes
0 answers
126 views

jsforce logout functionality

In one of my node project, I am using jsforce oauth2 to connect to Salesforce. This is working nicely. Below is the code I am using for logout functionality. This is also working fine without any ...
user avatar
1 vote
1 answer
156 views

JSForce Connection Time to Live [duplicate]

How long will a jsForce connection last? e.g. const connection:Connection = new jsforce.Connection({ loginUrl: process.env.SFDC_LOGIN_SERVER || 'login-url' }); // how long will this connection ...
user avatar
0 votes
1 answer
421 views

API Error: Wrong number of dashboardFilterColumns 1 instead of 2

I'm trying to use the metadata API to move a dashboard from one Salesforce to another, and I'm getting the error Wrong number of dashboardFilterColumns 1 instead of 2 The dashboard does have 2 ...
user avatar
  • 99
1 vote
1 answer
786 views

Salesforce OAuth giving invalid_grant(login.salesforce.com) or unsupported_grant_type(org url) error

Before anyone points that this question is repetitive, I would like to mention that I have tried possible solutions given in other similar questions like Change Application Permissions to Allow access ...
user avatar
0 votes
0 answers
33 views

Account lookupfield in bulkUpsert

I'm sending over custom Objects to SF using jsforce bulkUpsert. const foos = [{name:'test', accountBillTo:'123'},{name:'test2', accountBillTo:'123'}]; const upsertRes = await conn.sobject(&...
user avatar
0 votes
1 answer
430 views

Visualforce - Uploading Files via JSForce/JavaScript

I would like to upload an attachment greater than 135kb (view state limit) through Visualforce and link it to a new object record being creating via a custom controller. My understanding is that I ...
user avatar
0 votes
1 answer
49 views

Reading Dashboard with the metadata API not working

I'm trying to read all of the dashboards in a particular folder with the Metadata API. I'm using jsforce connection.metadata.readSync. The dashboards all appear similar in the UI, and most of them ...
user avatar
  • 99
0 votes
1 answer
298 views

Cannot update the value of a custom field on Case Object using jsforce

My Scenario I have a specific RecordType of a Case Called Customer Feedback. I can create a case with this specific record type like this: // Creates a new Case successfully, no custom fields. conn....
user avatar
  • 1
1 vote
1 answer
188 views

How can I insert custom metadata records using jsforce in nodejs?

I am trying to create a custom metadata record using jsforce but I cannot find any way to do it in documentation. I tried Metadata#create(type, metadata) conn.metadata.create('...
user avatar
0 votes
1 answer
39 views

pass parameters to then chain in promise

I'm using JSforce to retrieve an Account Id, once the operation is completed, I need to pass the retrieved account's Id and another Map to another function. testAsync(); function testAsync() { ...
user avatar
  • 1,431
0 votes
1 answer
87 views

Changing SearchLayout with metadata API

I'm trying to update SearchLayouts using the metadata API via jsforce. I am basically Retrieving the CustomObject (it's for Account but I think I need to do this to change the SearchLayout), removing ...
user avatar
  • 99
1 vote
1 answer
150 views

jsforce bulk load update insert '' values

I'm trying to clear some values while doing a bulk update with jsforce. I'm getting the values back from MySQL as ''. So in JS '' !== null. This does not clear the respective value in SF. I found Ref: ...
user avatar
0 votes
1 answer
21 views

Replaying soql with today/yesterday literals

I have a cron job that DLs records using a jsforce query. It runs at 9:30UTC and attempts to DL all records in that day and then ALL of yesterday (so it basically should be a total of all records ...
user avatar
0 votes
1 answer
46 views

Cost of bulkUpdate

I'm using jsforce to perform a bulkUpdate on Records. I have a broker Node App that retrieves records from an external API. It then needs to update said records to Salesforce. This Node app will ...
user avatar
1 vote
1 answer
469 views

Create a bulk job using JSforce

I am trying to create a bulk api query job using jsforce and nodejs. Below is the method i am calling after getting the access token. But it is not creating the job. Is the below way correct to create ...
user avatar
  • 1,516
0 votes
1 answer
46 views

Get email from personal information from User Object?

I need to fetch email of the user which they place under personal information but I seem to be getting back all the contact's emails of the user. So for the above example, I need user@abc.ai. My code ...
user avatar
  • 3
0 votes
1 answer
153 views

How to find if user is authenticating a Production or Sandbox when processing auth code received on Callback url?

I am working on a nodejs app using jsforce to authenticate users their Salesforce org with nodejs app and this is how it works at high level: User launches nodejs app and login screen is shown with ...
user avatar
  • 8,312
0 votes
1 answer
208 views

Access denied when using JSFORCE to connect and update records

we've developed an ecommerce website for a client and want to integrate with their salesforce to add opportunities when a potential client creates an order on the website. We had everything working in ...
user avatar
2 votes
1 answer
1k views

jsforce Bulk API query is not returning records in proper json format?

I am working on a nodejs app that uses jsforce library to query data using Bulk API and the format of data returned doesn't seem to be proper json formatted. Here is a simple reproducible example: // ...
user avatar
  • 8,312
0 votes
0 answers
74 views

JSforce login to salesforce from Chrome Extension [duplicate]

My goal is to listen for Steaming API events from Chrome Extension. In order to do that, obviously i must log in first and get a token. As embarrassing as it is, i am stuck at User Login phase. I have ...
user avatar
  • 101
0 votes
0 answers
100 views

Column 'type' not found

Good afternoon. The following code returns a weird error. I've looked at https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.html as a guide and from what I ...
user avatar
  • 119
0 votes
1 answer
837 views

Trouble updating a single custom field in a custom object.(JSForce)

Good afternoon, I'm having a bit of trouble updating a record using JSForce. I would like to update a single field named "BrightPath_Result__c", which is a field of "Deal__c". It ...
user avatar
  • 119
0 votes
1 answer
138 views

Calling REST APIs without storing SF credentials on the client side

I have 5 orgs that I want to be linked to my web server. My server gets POST calls from different Facebook accounts. These then have to be routed to Salesforce orgs according to the business that ...
user avatar
5 votes
2 answers
909 views

Download ContentVersion Object as JPG using JSForce

I am trying to download a JPG file stored as an attachment in Salesforce, to the local machine. I have a URL that works correctly when using a GET request in Workbench. When I try to do the same in ...
user avatar
1 vote
1 answer
320 views

Failed to update Salesforce account because of DUPLICATES_DETECTED error even with Allow setting in Duplicate Rule

I'm using JSforce to integrate Salesforce into my app. When I update a Salesforce account from my end via JSforce update function, it got DUPLICATES_DETECTED error because Salesforce considers this ...
user avatar
  • 11
1 vote
0 answers
136 views

transform records from jsforce bulk api query

I am trying to modify the results of a query that uses the bulk api by using the recordStream.on('record',...) function. I've stepped through the code but it making modifications here (or in other ...
user avatar
  • 11
2 votes
2 answers
549 views

I am doing API Automation Testing using JSForce to connect with Salesforce Connected App to create some data like "Opportunities" , "Accounts"

I am trying to connect to Salesforce using jsforce and create the Account using below code: const jsforce = require("jsforce"); conn = new jsforce.Connection({ // oauth2 : { ...
user avatar
0 votes
0 answers
671 views

JSForce GET Request Issue

I am using a LWC Open source app to make a GET request to my Salesforce Org. I want to get the resource at : https://na111.salesforce.com/services/data/v42.0/sobjects/EventLogFile/0AT3h00000PE85uGAD/...
user avatar
0 votes
1 answer
356 views

How do I get the logs (results) of executing anonymous Apex code in jsforce?

I have been trying to execute the following Apex code in jsforce (Node.js): var apexBody = "System.debug(UserInfo.isMultiCurrencyOrganization());"; conn.tooling.executeAnonymous(apexBody, function(...
user avatar
1 vote
2 answers
2k views

How do I get correct base64 data present in VersionData field in ContentVersion through jsforce?

I am using jsforce to query VersionData field in ContentVersion object. However, it returns me the URL to the base64 data instead of the actual data. If I make a GET request to the URL (using the ...
user avatar
1 vote
0 answers
29 views

Is there a way of retrieving records with ListViews AND with a certain communityId?

I'm currently getting records from listviews through the JsForce "listview" method and whenever i want to get records from a certain community i get them with the "find" method which i can pass the ...
user avatar
  • 243
0 votes
0 answers
387 views

JSForce Query Call returning Errror: "INVALID_SESSION_ID"

I am building an SFDC backend express application using JSForce. When making SOQL queries I am getting a INVALID_SESSION_ID error. I can authenticate using oauth2 without any issues. I have access ...
user avatar
0 votes
0 answers
402 views

Upload PDF to SalesForce Work Order using JSForce

I am trying to use JSForce to upload a PDF file to a WorkOrder in SalesForce. Here is the code I am trying to use, just don't know how to attach it to a work order ID fs.readFile(pdfPath, function (...
user avatar
1 vote
1 answer
4k views

I want to cover the onBlur event in javascript by writing JEST test case in LWC

In my html component i've used an onBlur attribute in div. While writing the test case for the same i am unable to cover the javascript method which I've called in html. My div looks like this <...
user avatar
1 vote
1 answer
581 views

JSForce retreiving VersionData problem [duplicate]

The task: We have over 1500 .msg files in Salesforce, which are Outlook containers for Mail conversations plus attachments. The idea is to build a script, which downloads all files, extract each ...
user avatar
  • 15
0 votes
0 answers
31 views

Error pushing Time from WebForm to SalesForce (Using JSForce as connector and direct REST to Push) [duplicate]

I am building a NodeJS WebApp, that serves up a form, User fills it out, submits it, and then pushes the data from the form to SalesForce. The App uses JSForce for Authentication, and then it uses a ...
user avatar
0 votes
1 answer
119 views

Filter quotes by owner division SOQL

I am using JsForce to query my orgs salesforce data. I am trying to select all quotes that belong to salespeople from my division. I am very new to SOQL and SalesForce so the best I have come up with ...
user avatar
1 vote
1 answer
39 views

Where does this Column come from (In Sql Query)?

I came across a Query that is very useful if I could figure out where a column name is being called from. (So I can edit and repurpose). The Query is: Select o.Owner.Username, o.OwnerId, o.Account....
user avatar
  • 135
1 vote
0 answers
313 views

Platform Event Limits regarding CometD and non-CometD clients

As per the Salesforce Documentation regarding Platform Event limits, in Performance or Unlimited Editions of Salesforce, maximum number of delivered event notifications within a 24-hour period, ...
user avatar
  • 1,232
2 votes
1 answer
381 views

jsforce query on ContentVersion returns the url rather than Base64 value

I am using jsforce for fetching ContentVersionData from a Node app. My query is SELECT VersionData FROM ContentVersion but instead of fetching the base64 value in VersionData field i m getting an url. ...
user avatar
  • 41
0 votes
1 answer
656 views

Call Standard salesforce rest api using jsfoce

I am trying to write a simple node app to get the record count from various objects in salesforce. Following rest api gives the count for objects mentioned in the request /services/data/v45.0/limits/...
user avatar
  • 365
1 vote
1 answer
747 views

Help with JSforce query - 'Bind variables only allowed in Apex code'

I'm trying to execute the following query using JSforce: conn.query('SELECT RecordId FROM UserRecordAccess WHERE UserId=:' + userId + 'AND HasReadAccess = true AND RecordId IN :' + listOfIds + ' ...
user avatar
  • 1,431
4 votes
0 answers
94 views

JSForce describeGlobal isn't working when the community has an added URL

I have to be able to get all objects on my salesforce community and whenever i utilize the jsforce library to get the connection by using this method "jsforce.Connection" let conn = new jsforce....
user avatar
  • 243