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
124
questions
0
votes
0
answers
40
views
How to create APEX triggers in salesforce using jsforce library
I am trying to create an Apex trigger on the Account object using jsforce. I've successfully established an OAuth connection, and I can query and create records without any issues. I've also tested ...
5
votes
1
answer
3k
views
Salesforce API throwing error some times while creating accounts:-> Error: Invalid URI "/services/data/v36.0/sobjects/Account"
We get this error from salesforce (in the sandbox environment) erratically while creating new accounts. Sometimes the account gets created successfully and at other times we get this error:
[Error: ...
0
votes
1
answer
947
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....
3
votes
1
answer
1k
views
Use JSForce to connect with a community/portal user
it possible to connect to sales force with a community license user using jsforce?
This is what I have tried
let conn = new jsforce.Connection({
loginUrl : 'https://login.salesforce.com'
});
...
0
votes
0
answers
69
views
OAuth2 connection inconsistency using JSforce
My Nodejs app has the option for users to sign-in using their devOrg. And my app is establishing an OAuth2 connection using authorization code grant. The whole sign in works perfectly fine. After the ...
1
vote
0
answers
93
views
Salesforce SOAP API Query Operation - Invalid Session ID Error
I am attempting to perform a SOAP query operation against the Salesforce SOAP API to retrieve data from the ConnectedApplication object. However, each time I try to execute the query, I receive an &...
4
votes
1
answer
202
views
What could we use as an alternative to JSForce
We have AWS Lambda jobs, created and maintained by a contracted company, that use jsforce for communication with our Salesforce instance. After a serverless code security scan of the Lambda code, a ...
1
vote
0
answers
111
views
Handling Complete Error Messages in JSForce Promises for Salesforce Apex REST Calls
In a Salesforce instance we have a web service to be consumed by an external service. Considering the resource that the ws will consume, it has been designed in such a way that for each request ...
5
votes
3
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 ...
0
votes
1
answer
114
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 ...
1
vote
1
answer
39
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')
....
1
vote
1
answer
276
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 ...
0
votes
0
answers
243
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....
0
votes
0
answers
139
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 = ...
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 ...
1
vote
2
answers
978
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(...
0
votes
1
answer
95
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 ...
-1
votes
1
answer
238
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 ...
0
votes
1
answer
1k
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 ...
1
vote
0
answers
387
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....
2
votes
1
answer
732
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 ...
0
votes
2
answers
126
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 ...
2
votes
2
answers
1k
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 : {
...
0
votes
1
answer
818
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: ...
2
votes
2
answers
438
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.
...
2
votes
3
answers
712
views
SFDX CI: Invalid record ID. Specify valid record ID value
I'm trying to follow Continuous Integration Using Salesforce DX trailhead module, however, I'm using my own repo (I didn't clone the sample repo that is provided).
I've used their .travis.yml file ...
4
votes
1
answer
8k
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 ...
2
votes
2
answers
2k
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 ...
1
vote
1
answer
757
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 ...
3
votes
1
answer
471
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 ...
0
votes
1
answer
171
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]",
&...
0
votes
1
answer
60
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 ...
1
vote
0
answers
357
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 ...
0
votes
0
answers
160
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", ...
6
votes
2
answers
7k
views
How to retrieve all available page layouts for an object?
I'm using the jsforce node package and I've tried the following:
conn.metadata.retrieve(
{
apiVersion: '38.0',
unpackaged: {
types: [
{
...
0
votes
2
answers
2k
views
Jsforce where clause having multiple conditions not working
This below code results in INVALID_FIELD: Test' AND ParentId = null AND EndDate > '2019-05-21' LIMIT 1 error.. How can I add more than one condition in where clasue?
const a = 2019-01-03
const b = ...
0
votes
1
answer
346
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", ...
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 ...
0
votes
1
answer
992
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 ...
5
votes
1
answer
3k
views
large bulk insert/delete using jsforce
When I'm trying to insertBulk a lot of records using jsforce, only 10k records get inserted (single bulk job is being registered). The same happens with bulkDelete, when piping query result to ...
1
vote
1
answer
296
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 ...
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 ...
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....
1
vote
2
answers
5k
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 ...
2
votes
1
answer
393
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 ...
0
votes
0
answers
467
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 ...
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 ...
2
votes
2
answers
3k
views
How to use "jsforce" in an external HTML client for streaming api?
I am trying to use streaming API feature of salesforce, and be able to subscribe to the topic in an external client which is HTML based.
My code is below:
<html>
<head>
<...
0
votes
1
answer
337
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 ...
1
vote
1
answer
770
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('...