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
2
votes
1answer
91 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
0answers
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 ...
0
votes
0answers
38 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 ...
1
vote
1answer
32 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
0answers
69 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 ...
1
vote
1answer
61 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 ...
0
votes
0answers
15 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(&...
0
votes
1answer
158 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 ...
0
votes
1answer
17 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 ...
0
votes
1answer
81 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....
1
vote
1answer
83 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('...
0
votes
1answer
30 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() { ...
0
votes
1answer
63 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 ...
1
vote
1answer
69 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: ...
0
votes
1answer
16 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 ...
0
votes
0answers
9 views

jsforce bulk undelete soft-deleted records [duplicate]

Is there any way to bulk undelete records in SF using jsforce? These would just be for soft-deleted records. There's bulk and single options for every other type of DB action you can take. I cloned ...
0
votes
1answer
38 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 ...
1
vote
1answer
174 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 ...
0
votes
1answer
28 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 ...
0
votes
1answer
82 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 ...
0
votes
1answer
86 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 ...
0
votes
0answers
187 views

Having a bulk api issue when trying to execute on linux. I am getting Error: connect ETIMEDOUT 13.110.30.13:443

I am wondering if there is something happening with salesforce? When I'm trying to run bulk query with jsforce it is giving me following error but sometimes it works fine. { Error: connect ETIMEDOUT ...
1
vote
1answer
568 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: // ...
0
votes
0answers
34 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 ...
0
votes
0answers
70 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 ...
0
votes
1answer
378 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 ...
0
votes
1answer
86 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 ...
3
votes
2answers
509 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 ...
1
vote
1answer
194 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
97 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
368 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
0answers
405 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/...
0
votes
1answer
216 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(...
1
vote
2answers
868 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
0answers
26 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 ...
0
votes
0answers
281 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 ...
0
votes
0answers
326 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 (...
1
vote
1answer
2k 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
410 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 ...
0
votes
0answers
29 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 ...
0
votes
1answer
85 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 ...
1
vote
1answer
33 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
0answers
249 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, ...
2
votes
1answer
276 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. ...
0
votes
1answer
383 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/...
1
vote
1answer
511 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 + ' ...
4
votes
0answers
83 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....
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 ...
0
votes
1answer
89 views

How to use jsForce to call Datacloud.FindDuplicates.findDuplicates()?

I nedd do something like this: https://developer.salesforce.com/docs/atlas.en-us.210.0.apexcode.meta/apexcode/apex_class_Datacloud_FindDuplicates.htm#apex_class_Datacloud_FindDuplicates I also find ...
1
vote
1answer
392 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 ...