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
0 answers
35 views

OmniOut + localhost:4002 error

Premise: I want to host my Omniscripts in a third-party CMS system but before that I have to demo that I can display my Omniscripts even on localhost. I followed this and this. My node version is 14....
user43598's user avatar
  • 427
0 votes
2 answers
73 views

DON'T send welcome email from Node.js

I'm creating a Node.JS/JSForce/Express API to create external identity users in SF, but I don't want the user to receive the welcome email for the Experience Site they're enrolled in, although users ...
kevstev01's user avatar
  • 109
0 votes
1 answer
266 views

In Salesforce CPQ, Do Summary Variables Count Towards Governor Limits?

Consider the following two Salesforce CPQ scenarios: 1) In one scenario, a Summary Variable can have the following values: Aggregate Function: Sum Aggregate Field: SBQQ__ListPrice__c Target Object: ...
Sully Cooper's user avatar
0 votes
0 answers
59 views

JS force Bulk API pass allOrNone options

Currently, with the code I have written below, if one of the record is invalid, the entire operation fails. It does not go to the response event. const accounts = [ { Namee: 'Account #16 Test ...
baqir's user avatar
  • 1
2 votes
2 answers
145 views

Can I use jsforce to launch/invoke a lightning flow

I have an auto launch flow that I'd like to act as an API endpoint. The flow receives a few variables and creates tasks and cases. I've used jsforce to call an apex rest API like it's explained here. ...
Bahman.A's user avatar
  • 768
0 votes
0 answers
57 views

JSForce DISTINCT Equivalent

I'm looking for the equivalent of a DISTINCT SQL clause using JSForce. Here's an example of what I would like to do (with incorrect syntax of course): conn.sobject('Custom_object__c') .find( {'...
risingTide's user avatar
1 vote
1 answer
118 views

Add a customField to ContentVersion

TLDR: How do I retrieve a ContentVersion Object by customfield (jsforce or SOQL) and then how would I then populate that customfield? More below: I need a way to keep track of notes between two ...
Rogelio's user avatar
  • 115
3 votes
1 answer
296 views

Simplest way to do a web page login for a Node jsforce command-line app?

I have some automation that runs on Node/jsforce and am using this code: connect() { const command = `sfdx auth:web:login -r ${this._instanceUrl} --json`; const response = await ...
Keith C's user avatar
  • 134k
0 votes
1 answer
40 views

How to add an org instanceUrl, username and password to a config file from a Bitbucket pipeline?

This relates to How to test a jsforce Node app that requires a security token? As it took me several yours to get this to work, I'm sharing the results to save anyone else needing to do this some of ...
Keith C's user avatar
  • 134k
0 votes
1 answer
110 views

How to test a jsforce Node app that requires a security token?

Our Node app that uses jsforce bulk upload APIs has a configuration file including this information: "salesforce" : { "username": "...@example.com", &...
Keith C's user avatar
  • 134k
0 votes
0 answers
582 views

Jsforce connection leaves open handle when unit testing with Jest

I am trying to write a simple unit test for a Firebase function that connects to Salesforce using JSForce however when running the test, the unit test passes however jest throws a warning: Jest has ...
Tom S's user avatar
  • 1
1 vote
0 answers
194 views

How to use JSForce in Client side LWC in LWR [closed]

I created a SPA application using LWR by following the steps mentioned in lwc.dev. I am trying to use this App inside of Chrome Extension. As part of this, i want to make some API Calls to salesforce ...
Ravi Narayanan's user avatar
0 votes
0 answers
108 views

Not able to call Rest API from node-salesforce library

I am trying to hit salesforce restAPI using node-salesforce(primarily - jsforce) and here is the code var jsforce = require('node-salesforce'); restService.post("/searchAppointment", ...
SFDC buddy's user avatar
1 vote
2 answers
700 views

Change Data Capture Event - retrieving values for all fields

I have been using the Pub/Sub api to subscribe to /data/OpportunityChangeEvent that I have setup in the Change Data Control events. I was hoping this would give me a full replacement object that I ...
SteckDEV's user avatar
  • 111
0 votes
1 answer
205 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", ...
fred's user avatar
  • 1,102
0 votes
1 answer
403 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 ...
CodeMonger's user avatar
1 vote
1 answer
162 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 ...
Andrew Prokop's user avatar
2 votes
1 answer
732 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 ...
user43598's user avatar
  • 427
3 votes
1 answer
801 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....
Matthew Souther's user avatar
2 votes
1 answer
295 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 ...
Kat's user avatar
  • 99
0 votes
0 answers
342 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 ...
Somnath Paul's user avatar
2 votes
1 answer
418 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 ...
binarygiant's user avatar
0 votes
1 answer
1k 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 ...
Kat's user avatar
  • 99
3 votes
1 answer
3k 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 ...
Rohan Shenoy's user avatar
0 votes
1 answer
875 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 ...
SpicyPat's user avatar
0 votes
1 answer
205 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 ...
Kat's user avatar
  • 99
0 votes
1 answer
703 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....
Gene's user avatar
  • 1
1 vote
1 answer
556 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('...
Paweł Borys's user avatar
0 votes
1 answer
1k 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() { ...
Json's user avatar
  • 1,557
0 votes
1 answer
158 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 ...
Kat's user avatar
  • 99
1 vote
1 answer
332 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: ...
user2402616's user avatar
0 votes
1 answer
149 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 ...
user2402616's user avatar
0 votes
1 answer
51 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 ...
user2402616's user avatar
1 vote
1 answer
1k 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 ...
sfdc_to_learn's user avatar
0 votes
1 answer
123 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 ...
baqir's user avatar
  • 3
0 votes
1 answer
260 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 ...
javanoob's user avatar
  • 8,627
0 votes
1 answer
456 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 ...
Jacques Rouleau's user avatar
2 votes
1 answer
2k 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: // ...
javanoob's user avatar
  • 8,627
0 votes
0 answers
76 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 ...
Alexander's user avatar
  • 111
0 votes
0 answers
166 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 ...
PaulyP's user avatar
  • 167
0 votes
1 answer
2k 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 ...
PaulyP's user avatar
  • 167
0 votes
1 answer
281 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 ...
Apex Srinivas's user avatar
5 votes
2 answers
2k 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 ...
Scott Harrison's user avatar
1 vote
1 answer
560 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 ...
Tan Vo's user avatar
  • 11
1 vote
0 answers
195 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 ...
ben's user avatar
  • 11
2 votes
2 answers
870 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 : { ...
chaitanya vn's user avatar
0 votes
0 answers
1k 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/...
Apex Srinivas's user avatar
1 vote
1 answer
625 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(...
Sumit Israni's user avatar
1 vote
2 answers
3k 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 ...
Sumit Israni's user avatar
1 vote
0 answers
32 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 ...
JPG's user avatar
  • 243