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
6
votes
0answers
161 views

Push topic message event type is always "updated" even when inserting object

I'm subscribed to two different push topics, and one of them doesn't register any event types as "Create" only as an "Update". My config for the working push topic is as follows: { "Name": "...
5
votes
1answer
2k views

What is the difference between JSFORCE and SFORCE?

What is the difference between JSFORCE and SFORCE?
5
votes
1answer
1k views

How to use JsForce in a Salesforce Lightning Component

BACKGROUND I would like to be able to interact with the various Salesforce REST API from client-side JavaScript code, without needing to go via a Apex controller method and then making a separate ...
5
votes
1answer
2k 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 ...
5
votes
2answers
714 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 ...
4
votes
1answer
5k 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: [ { ...
4
votes
1answer
3k views

How to call Standard REST service in POST request using JSforce?

I am using JSforce, a module of Node.js for Salesforce. The login credentials are obviously not correct in this script but they are correct in original script and they are working fine. Here is app.js ...
4
votes
1answer
1k views

Invoking metadata API call using JSFORCE

Consider: <apex:page applyHtmlTag="true"> <apex:includeScript value="{!$Resource.Jsforce}"/> <input type="file" id="input"></input> <script type="text/...
4
votes
0answers
90 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....
4
votes
1answer
2k 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: ...
3
votes
2answers
1k views

Jsforce in Lightning Component controller

Can we use JsForce in Lightning component? I need to Describe SObject i.e., retrieve Field data types for an object in lightning component helper. Would like to check if I can use JsForce instead of ...
3
votes
1answer
868 views

Problem with JSForce

I am trying to access the REST API using JSForce. I am connecting fine via OAuth, signing in and being redirected to where I need to be with my access token, etc. After that I am trying to access the ...
3
votes
1answer
443 views

Third party lead generation service scope access for creating new leads

Background: We're a lead generation service. We sell the leads (as a subscription) to multiple customers. Many of our customers use Salesforce. I'm trying to create an app that will create/push new ...
3
votes
1answer
1k views

Best way to automate updating contact emails in sandboxes post refresh?

I'm looking for a way to automate the process of updating emails of all active contacts in sandboxes (mask them with the .dev or .test). Number of records to update after filtering: 900,000 Things I'...
3
votes
1answer
780 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' }); ...
3
votes
0answers
2k views

Problems authenticating using JSForce

so I've been trying to use JSForce to authenticate into SF. I used both the first example with SOAP API login and the second one with OAuth2: https://jsforce.github.io/document/#connection However, I ...
2
votes
1answer
122 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 ...
2
votes
1answer
761 views

I am querying more than 2000 records. Is it a good idea to use the BULK API?

I'm new to the Salesforce community, so I apologize if this question is asked wrong. I was running into essentially the exact same problem mentioned in this post. Basically, I have a query that ...
2
votes
1answer
810 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: // ...
2
votes
1answer
330 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. ...
2
votes
2answers
2k views

How to get all records from Report using JSforce NodeJS

I am trying to get all records from a specific Report. I am using NodeJS and the library JSforce. I have tried using the following code: var report = conn.analytics.report(reportId); report.execute({...
2
votes
1answer
1k views

Query Data with JSforce Using Connected App [closed]

I want to use package JSforce to Query SF data using external app. Can do it quite easily by using userName/password/token conn.login('someusername', 'somepassword+token', function(err, userInfo) { /...
2
votes
1answer
429 views

Metadata Deploy from JSforce doesn't work in production

I have a managed package containing a VF page that uses JSForce to deploy a zipped package of metadata when a user clicks a button. Inside the package I'm trying to deploy is 2 classes and a trigger, ...
2
votes
1answer
38 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 ...
2
votes
3answers
545 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 ...
2
votes
0answers
570 views

REST API - Issue connecting JS app when CORS and Remote Site are both setup properly

I cannot connect to Salesforce to automatically create accounts from my javascript app. I continue to get the error: "Failed to load https://login.salesforce.com/services/oauth2/token: No 'Access-...
2
votes
0answers
659 views

No 'Access-Control-Allow-Origin' header error using jsforce in React app (200 OK, CORS Added)

I'm having this issue when attempting to access the Salesforce API from my React app (inside a vf page). Seems odd that it would recognize this as a cross-origin request, but I whitelisted the origin, ...
2
votes
1answer
411 views

Unable to update GlobalValueSet in managed org using jsforce metadata api

I have a managed org where I want to update my 'GlobalValueSet' using jsforce metadata api, but when I try to update I got following error : Cannot modify managed object: entity=...
2
votes
0answers
203 views

How to remove "No Access-Control-Allow-Origin" error while using steel brick quote calculator plugin

I am getting this error while calling rest api from jsforce on quote calculator plugin . XMLHttpRequest cannot load https://pdc--setup.cs52.my.salesforce.com/services/apexrest/SBQQ/ShippingCal. ...
2
votes
0answers
85 views

Any clue as to why I am not able to use heroku environment variables in my jsforce auth function?

So I'm part of a team working on developing an a web app for our client, who uses salesforce as their database. We are using node.js on heroku to act for the server side code. The front end is angular,...
1
vote
1answer
630 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 + ' ...
1
vote
1answer
2k views

Best practice for reconnecting with jsforce?

The below is working really well, but every now and then it times out after awhile with this error: [Error: Invalid URI "/services/data/v37.0/sobjects see: https://github.com/jsforce/jsforce/issues/...
1
vote
2answers
433 views

Is JSforce safe to use?

I saw a JSForce code example on another site. It looks like one put their username and password in the code. Did I get that correct or is there a way to connect to SF without risking security? Can ...
1
vote
1answer
309 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 ...
1
vote
1answer
111 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: ...
1
vote
1answer
35 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....
1
vote
1answer
477 views

invalid_grant: expired access/refresh token with refresh token included in JSForce

I am trying to build a server that will populate Salesforce through a front end website using Express JS with JSForce library. However, every time the access token expired, it does not refresh by ...
1
vote
2answers
2k 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> <...
1
vote
1answer
726 views

SOQL Order By field in child relationship

I'm trying to use SOQL (with JSForce in a nodejs app) to execute a query like what is below. SELECT Name, Oppnum__c, Id, ( SELECT CreatedDate FROM Times__r ORDER BY CreatedDate DESC LIMIT 1) FROM ...
1
vote
1answer
21 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 ...
1
vote
1answer
127 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('...
1
vote
2answers
1k 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 ...
1
vote
1answer
3k 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 <...
1
vote
1answer
1k views

How to download a attachment in browser using JSForce?

I am trying to download a Attachment using JSForce library. I am able to get body of attachment and download that file but somehow content of downloaded file is not correct and I am getting a corrupt ...
1
vote
1answer
75 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 ...
1
vote
1answer
299 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
1answer
271 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 ...
1
vote
0answers
107 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 ...
1
vote
2answers
471 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 : { ...
1
vote
0answers
27 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 ...