Questions tagged [java]
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
403 questions
0
votes
0
answers
60
views
Does Salesforce Pub/Sub API have a Java 8-compatible version?
I am working on a Salesforce integration project that requires subscribing to Platform Events using the Pub/Sub API. Due to constraints, my Java application must run on Java 8 (1.8), using Eclipse ...
0
votes
0
answers
36
views
Set custom serverURL when consuming Salesforce enterprise wsdl from Java
We have a SOAP integration from a Java-based application towards Salesforce. The Java app uses a jar file generated from the enterprise WSDL to connect to Salesforce. Before, the application used to ...
1
vote
0
answers
138
views
JWT flow give {"error":"invalid_grant","error_description":"user hasn't approved this consumer"} for scratch org
I have a test connected app setup in my scratch org with api, refresh_token and required scope enabled. I also added admin approved profiles and permission set to the connected app.
I have three users ...
2
votes
0
answers
50
views
Heroku Quick Start is not creating an App from Salesforce
I am having a weird issue when I try to create a Heroku App from my Canvas App Previewer in Salesforce. I have already registered on Heroku and added my Billing details. Now I navigate to Canvas App ...
0
votes
1
answer
69
views
Getting profile permissions using readMetadata() API call
I would like to retrieve the recordTypeVisibilities for all the record types for a particular profile. Is there a way to achieve this using the readMetadata() API call instead of doing a file based ...
1
vote
1
answer
162
views
Java force-tooling-api pom dependency is not available anymore
Trying to add the "Force Tooling API" dependency to my java project from the https://mvnrepository.com/artifact/com.force.api/force-tooling-api/32.0.0 repo:
<!-- https://mvnrepository.com/...
0
votes
1
answer
561
views
Unable to customise Android notification
I have implemented the React Native SDK and I am successfully receiving push notifications on both platforms.
The problem I am having is that, on Android only, the notification builder seems to be ...
0
votes
2
answers
582
views
Future method executing (success), but not working
I bulk-updating phone numbers on objects, following method working on single or multiple numbers, but when I delete conditions in query for low amount of records, its exception CPU time exceeded. So I ...
1
vote
2
answers
776
views
Class level object initialization throws NullPointer Exception
I have two public classes class A and class B in two different packages.
So when I try to initialize class B inside class A, it throws a null pointer exception. Something like :
public class A {
...
0
votes
1
answer
619
views
How to target a retrieved data extension in a FOR LOOP while using WSProxy
Currently, I am using the following approach to define my Data Extension
Platform.Load("core","1");
// instantiate the WSProxy object to make API calls
var api = ...
1
vote
3
answers
1k
views
Get values from nested JSON dictionaries in Apex
I'm trying to make use of the Jira Rest API from within Salesforce. I am somewhat useless with Java, so hopefully someone can point me in the right direction.
I can use the following Apex to get an ...
-1
votes
1
answer
107
views
Not able to create partner jar
Please note I have checked previously posted questions related to this topic, but my issue is not resolved. All the related and required jar files are in one folder (C:\SOAP) and I run below command, ...
2
votes
2
answers
315
views
Lombok for Salesforce Apex
I'm looking for some solution, which helps me to write less code in Apex.
Is there any tool like Lombok for Java.
1
vote
1
answer
1k
views
Convert code snipet from Java to Apex
I am trying to do an api call and am getting a 403 error. I am putting the apex code below that is getting the 403 error. We opened a ticket with the company that we are sending the callout to and ...
-2
votes
1
answer
151
views
Need Help on Encryption and decryption logic [closed]
I wanted to write exact below java code in apex. I am aware of EncodingUtil.base64Decode() and Crypto class method in SF. But this byte array and Cipher, etc , am not aware of it.
class Encyrpt{
...
1
vote
1
answer
2k
views
What's wrong at setting Java Home in Visual Studio Code for enabling Apex Tests?
I wanna enable Apex Tests in my workspace in VS Code, but I am unable to find out what is wrong.
Here are my possibilities:
Here is the setting that I am putting...
{"salesforcedx-vscode-apex....
0
votes
1
answer
355
views
How do I assign a output from a get method to 'accountId'
I'm struggling to find a way to set my accountID value to the returned value of my get parentAccountName() method.
The method works and returns the value successfully, but when trying to assign it to ...
0
votes
1
answer
279
views
Can I upload Java class as a Jar file in Static Resource and use that Java class components in Apex class?
I have piece of code in Java language, I need to use it in apex class. Let me know if I can upload Java class as Static Resource and use it in Apex class?
1
vote
0
answers
185
views
Convert decoding from JAVA to apex
I have a method that was implemented on JAVA, but I need it in Apex
public static String decryptAccountInformation(String websitekey, String document,String encryptedAccount) {
String key = ...
5
votes
1
answer
1k
views
Data Loader on MacOS - java.lang.NullPointerException with Zulu/OpenJDK 11
Last login: Thu Aug 27 14:29:01 on ttys000
/Users/vamshikrishna/dataloader/v49.0.0/dataloader.command ; exit;
vamshikrishna@MacBook-Pro-6 ~ % /Users/vamshikrishna/dataloader/v49.0.0/dataloader.command ...
0
votes
1
answer
933
views
Usage of salesforce bulk api for integration with java using rest
I am new to salesforce, hence this long post. I wanted to create a java app to do CRUD on salesforce. I have followed the rest api tutorial, and created app for fetching data from salesforce using ...
0
votes
1
answer
229
views
How to create a records as another user with Salesforce OAuth AccessToken
Am able to create the records as an admin using the OAuth access_token. But, here I need to create a record as another user with the OAuth access_token.
Could you please share the sample code.
Thanks ...
0
votes
2
answers
166
views
Optimization of code removing extra if and else block
I need to remove the extra if and else loop as per the req and need to make it short for reading of the code should be easy.
can anyone suggest some better for below:
if (data[0].FA_N__c) {
...
0
votes
1
answer
1k
views
Javascript ternary operator
I need to set a constant value as true or false for the particular scenario not sure correct working or not
const test = data.findIndex(d => d.Fname === '' && d.Lname === '') < 0 ? false ...
1
vote
1
answer
557
views
Check if a substring is repeating in a string
My requirement is to find if a unknown string of 4 chars is repeating of a string of length 16.
So basically, INPUT : "shgtHellorhecHello" Should return true.
Only known thing to us is that the ...