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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

BayeuxParameters instantiation error with SpringBoot 3.0.x version [closed]

We have subscribed to Salesforce Queue using EmpConnector.java from Salesforce. This has worked until Spring boot version 2.7.x. While we migrate to Spring boot 3.0.x below exception is thrown on ...
  • 1
0 votes
0 answers
35 views

Crash Exception java.lang.NullPointerException: 'void com.salesforce.marketingcloud.analytics.stats.b.a(java.util.Date)' on a null object reference

Crashes reported in production by Google Play Console This issue has been around at least since July 2022 but likely earlier. Unfortunately I cannot provide a reproducible sample as it appears to be ...
  • 11
0 votes
0 answers
41 views

How to use SalesForce specific objects for soap api in java

We are trying to use Fuel SDK to be able to get the latest updates but Ssome Objects are missed in Java Fuel SDK like below ones: I need to use these classes but I am not able to find it in fuel sdk ...
  • 13
0 votes
0 answers
41 views

How to use AggregateResult in java code using Partner wsdl of salesforce

Query: Select count(id) from Account When i execute the above query using java code I am unable to fetch the records it gives null value whenrun through java code. From the following link https://...
0 votes
2 answers
99 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 ...
  • 47
0 votes
2 answers
370 views

Java runtime error for JDK 17 on VS Code

I keep getting the below message but I have checked and set up the path in Java: Home to the path mentioned in the below message ("salesforcedx-vscode-apex.java.home": "C:\Program Files\...
1 vote
2 answers
164 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
0 answers
284 views

Java Exception while attempting to stablish gRCP connection: UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol

I'm trying to establish a connection between a java service and salesforce using a gRCP connection on the PubSub API. While trying to make a synchronous call TopicInfo topic = pubSubBlockingStub....
  • 1
0 votes
0 answers
22 views

How can I generate encrypted key in apex same as generated by the below java class [duplicate]

package com.fivestar.crypto; //of Encryption with Java AES import java.security.NoSuchAlgorithmException; import javax.crypto.NoSuchPaddingException; import javax.crypto.Cipher; import java.security....
0 votes
0 answers
44 views

Salesforce PartnerConnection(Partner Api) object not passable as response

I am able to successfully connect to Salesforce using Soap API login method from Stub files Partner WSDL in Java. As per Soap Api documentation, PartnerConnection object should be used to retrieve any ...
  • 1,311
0 votes
1 answer
169 views

Performing a record retrieval via WSProxy in SSJS

In my data extension, I have two fields / columns: JobID DE_NAME In this use case i want to receive the value for JobID and DE_NAME (1st row only) var queryAllAccounts = true; var cols = [&...
  • 169
0 votes
1 answer
174 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 = ...
  • 169
0 votes
1 answer
71 views

How to know AccountTeam in Salesforce is enabled or disabled through any API with Java?

Java Code: I have coded the following using REST API to connect to Salesforce. Following code is from the URL to get Schema or fields of AccountTeamMember (standard) object after establishing ...
1 vote
3 answers
830 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 ...
  • 43
-3 votes
1 answer
1k views

How to add many values at once in Apex? [closed]

I have a list like that: List l = new List(); l.add('a'); l.add('b'); l.add('1'); l.add('2'); l.add('3'); How can I add all those values at once without using so many add methods? In Java we can do ...
-1 votes
1 answer
53 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, ...
4 votes
0 answers
73 views

Fails to update ContentVersion with Java SOAP API

I am querying some records of type ContentVersion, changing Title then updating that records through ContentVersion contentVersionToUpdate = new ContentVersion(); contentVersionToUpdate.setTitle(...
0 votes
0 answers
83 views

FuelSDK - ETClient constructor initialization creating exception

This is my example code and i am getting an exception from Runtime Modeler Exception. try { ETConfiguration configuration = new ETConfiguration(); configuration.set("...
2 votes
2 answers
170 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.
0 votes
0 answers
456 views

WS security to SOAP request header from java client

I am trying to connect to Salesforce from java client using SOAP api. All the examples in the documentation point to a using ConnectorConfig class to connect from java. However I need to set wsse:...
1 vote
1 answer
452 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 ...
0 votes
1 answer
155 views

Upgrading dataloder salesforce on macos for the log4j

I am trying to upgrade the dataloader to mitigate the log4j vulnerability. I have tried to follow the steps on the github repo but i am getting this error trying to build with "./dlbuilder.sh -n&...
  • 116
-2 votes
1 answer
100 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
0 answers
559 views

Using Mutual Authentication and I receive 403 Forbidden error from Salesforce API

I have set up Mutual Authentication on my Salesforce org so that my project can use two ways SSL with Salesforce. Here are my steps: 1- I use a CA sign certificate (GoDaddy) and upload it to the Set ...
  • 111
1 vote
1 answer
840 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
61 views

Heroku fails to build Java application with XSL transformation

I have just attempted to deploy onto Heroku a change to my Java 8 application, which includes an XSL transformation. The deploy fails because the Maven build fails, with the message: cannot find ...
0 votes
1 answer
125 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 ...
1 vote
1 answer
131 views

Update an object - SOAP API /Selenium Java

I've faced an issue. I'm trying to create a method to update a requirement in Salesforce. (I'm using Selenium - Java) and I have the following error. " The method update(com.sforce.soap....
  • 13
0 votes
1 answer
128 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?
0 votes
1 answer
175 views

How to read apex classes from outside java application?

Need assistance with how can I read apex class lines? which API should I use for accomplishing this REST or SOAP? Please help.
1 vote
0 answers
114 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 = ...
0 votes
1 answer
125 views

What's the best way to pull all the Metadata types from the Salesforce?

I have used describeMetadata() call to fetch the xml names but it's showing only few out of what we have in the Metadata coverage url. I was wondering if there is a way to pull all the Metadata types ...
4 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
41 views

Mismatch in custom object field count in rest api and salesforce UI

I have a java codebase for performing CRUD on salesforce as an rdbms db. I was looking at the response on my rest api and that on SF setup UI of a custom object that I create in object manager. I have ...
0 votes
1 answer
488 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
41 views

not able to get FaultString in soap api JAVA

I am trying to get faultstring from SoapFaultException class but can only get faultcode but not faultstring. Code snipped : public static Object querySf(String query , PartnerConnection pc) throws ...
0 votes
1 answer
136 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 ...
  • 1
0 votes
2 answers
276 views

How to retrieve status of an Automation using Java FuelSDK

I'm using Java 8 with FuelSDK and am trying to retrieve some Automations but can however not wrap my head around how do it. I am able to fetch the DataExtensions using the following code: ...
0 votes
2 answers
117 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) { ...
  • 3
0 votes
1 answer
67 views

Lightning Web Component findIndex [duplicate]

Hi I need help with the method that follows: var ages = [3, 10, 18, 20]; function checkAdult(age) { return age >= 18; } function myFunction() { document.getElementById("demo").innerHTML = ...
  • 3
0 votes
1 answer
624 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 ...
  • 3
1 vote
2 answers
5k views

Data Loader Won't Open

I have followed the instructions given for downloading Data Loader to a T. Every time I tried to open Data Loader after installation, it would just say I don't have zulu installed and then just close.....
0 votes
1 answer
659 views

Salesforce SSL Cert imported into java trust store for integration works on the day imported but gives certificate error the next day

I am importing the Salesforce SSL certs for the test.salesforce.com and our sandbox environment using the commands below in a VM server environment. Import test.salesforce.com or login.salesforce.com ...
  • 150
0 votes
0 answers
128 views

How to use ETDataExtension / ETResponse / ETConfiguration by Salesforce Marketing Cloud Java SDK

I need to download more than 2500 Rows from tables of Salesforce Marketing Cloud with following code(for ETSubscriber): ETConfiguration configuration = new ETConfiguration(); configuration....
  • 1
1 vote
1 answer
344 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 ...
0 votes
1 answer
91 views

Salesforce Marketing Cloud download API Biggest Table

I'm trying download, for Soap calls, tables of Salesforce Marketing Cloud with 1 million or more rows but the process is very slowly. For each download I can only get 2.500 records, ok. I have used ...
1 vote
0 answers
48 views

Serialize Workflow object to XML

I'm developing a test application that modifies the workflow by reading the retrieved Workflow files that are downloaded. The files are read, the workflow switch is modified and submitted to Metadata ...
  • 1,089
0 votes
2 answers
75 views

Comparing two date fields and writing an Utility Class - Apex, Salesforce

I have two date fields Manager_recruitment_date__c Recruitment_officer_date__c I would want to write a utility class where I want to compare both these fields, and take the Max date and use it ...
0 votes
1 answer
328 views

Why I don't receive proper results by running query in Apache Camel?

MyRouteBuilder.java rom("direct:select") .log("============Query to salesforce===========") .to("salesforce:query?sObjectQuery=select Id,Name,PSA_Activity_Sequence__c,...
  • 1
0 votes
1 answer
276 views

Unable to Compare two Strings in Salesforce - APEX

I am trying to Compare two strings which are delimited by SEMI-COLUMN (;). I have made sure I SPLIT them and the store them in lists. In the below example, I receive an error for BALL for all other ...

1
2 3 4 5
9