Ad
Jsforce Search Does Not Work On Contact Using Like Operator
my code looks like
const conn = new jsforce.Connection({
oauth2: {
loginUrl: SFDC_LOGIN_URL,
clientId: SFDC_CLIENT_ID,
clientSecret: SFDC_CLIENT_SECRET,
redirectUri: SFDC_REDIRECT_URI,
},
instanceUrl : baseUrl,
accessToken : ACCESS_TOKEN,
refreshToken: REFRESH_TOKEN
});
const resp = await conn.query("SELECT Id,Name,Title,Email,Phone,Department FROM contact WHERE name LIKE 'michael%25' ORDER BY LastModifiedDate DESC LIMIT 10");
this returns now result
if i directly fire this query using postman then i see the data.
if i remove the like part and keep the query to
SELECT Id,Name,Title,Email,Phone,Department FROM contact ORDER BY LastModifiedDate DESC LIMIT 10
then i see the data. So there is some issue with where clause. Plz advise
Ad
Answer
Try with '%', not '%25'. I think you're urlencoding the '%' and then jsforce does it 2nd time, messing your query up.
Ad
source: stackoverflow.com
Related Questions
- → Is It Possible To Use An External Database For User Data & Login Credentials With Shopify?
- → Change Database Source Depending on Login Credentials
- → JSON iteration in JAVA using jettison library
- → SyntaxError: Cannot use import statement outside a module in JEST LWC
- → Salesforce REST API query - URL limit
- → Regex to mask characters except first two digits in Java
- → How to make Multilevel Drop down navigation in wordpress theme?
- → laravel salesforce require_once?
- → Getting "INVALID_FIELD_FOR_INSERT_UPDATE" error message when try to update Salesforce Contact objet via Java(EnterpriseWSDL)
- → Infinite loop on ComponentWillMount ReactJS
- → how to get current date in MOMENT.JS Dynamic
- → Why i can't add Approval record row into the CR ticket
- → Pagination In Custom APEX REST Endpoint
Ad