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
24 views

How to load (image) file using REST API using Acces Token in authorization Bearer?

Using an access token I can successfully receive Query responses. Now I would like to load an (image) file URL using the same method, but it returns a 302 redirect with JavaScript code to redirect (I ...
Z0q's user avatar
  • 155
1 vote
1 answer
27 views

jsforce runTestsSynchronous not working?

I'm trying to run Apex tests using JSForce and it returns me the error: Catch error: TypeError: classnames.join is not a function I'm making a post request salesforceAuthRouter.route('/playground') ....
Aslah P Hussain's user avatar
1 vote
1 answer
134 views

Refreshing Access Token generated unexpected 'invalid_grant: expired access/refresh token'

When I authenticated using oAuth, I received an access token and a refresh token, with which I am able to query data from Salesforce. The access token is working correctly, but once it expires, I ...
Z0q's user avatar
  • 155
0 votes
0 answers
65 views

How to update Custom Metadata Type records with JSforce

I am working on a node.js script where now I aim to update a Custom Field of a Custom Metadata Type record. So far, I have tried few different things, all of them without success: await connection....
Gabriel Serrano Salas's user avatar
0 votes
0 answers
56 views

JSForce connection with connected app returns undefined

I am using the below code to establish a connection with Salesforce connected app - const express = require('express'); //Adding Express const http = require('http'); //Adding http const jsforce = ...
sumchans's user avatar
  • 767
0 votes
1 answer
64 views

How to retrieve Salesforce Org Feature settings such as Activity Settings

Is there an easy way through APEX (like Schema.describe) to access feature settings in an org? Specifically we are interested in checking if Feature Settings -> Activity Settings -> Enable ...
Nelson Ramalho's user avatar
-1 votes
1 answer
136 views

Connect to Salesforce using Jsforce (Pure Javascript)

I am trying to create a chrome extension for a specific usecase. I would like to know how to connect to salesforce using jsforce. I have tried access salesforce by creating a connected app and then ...
Jakka rohith's user avatar
0 votes
1 answer
912 views

jsforce CPQ quote & quoteline force recalculation

I'm trying to load Salesforce with some test data for Salesforce CPQ, but can't get the quotes (SBQQ__Quote__c) nor the quote line items (SBQQ__QuoteLine__c) to "recalculate". My process is ...
tester's user avatar
  • 55
0 votes
0 answers
225 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
  • 457
0 votes
2 answers
114 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
634 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
2 votes
2 answers
366 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
  • 828
1 vote
1 answer
456 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
420 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
  • 136k
0 votes
1 answer
51 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
  • 136k
0 votes
1 answer
156 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": "[email protected]", &...
Keith C's user avatar
  • 136k
1 vote
0 answers
300 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
150 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
1k 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
294 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
  • 3,215
0 votes
1 answer
780 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
238 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
1k 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
  • 457
3 votes
1 answer
1k 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
371 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
435 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
606 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
2k 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
6k 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
1k 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
279 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
906 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
686 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
2k 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,587
0 votes
1 answer
226 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
435 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
298 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
75 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
249 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 [email protected]. My code ...
baqir's user avatar
  • 3
0 votes
1 answer
332 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,847
0 votes
1 answer
588 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,847
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
186 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
  • 307
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
  • 307
0 votes
1 answer
403 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
705 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
216 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