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
3 answers
27 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 ...
user avatar
  • 23
-1 votes
1 answer
27 views

How to add many values at once in Apex?

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 ...
user avatar
-1 votes
1 answer
25 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, ...
user avatar
-1 votes
0 answers
9 views

SOAP API: Using CXF client to connect

How can I add an Access token into the SOAP header using the CXF java client? Because earlier, I was using username and password to authenticate in a UAT environment. But in Production, I'm getting a ...
user avatar
4 votes
0 answers
33 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(...
user avatar
0 votes
0 answers
9 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("...
user avatar
2 votes
2 answers
82 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.
user avatar
0 votes
0 answers
40 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:...
user avatar
1 vote
1 answer
100 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 ...
user avatar
0 votes
0 answers
45 views

Salesforce report API - How to fetch more than 2000 records from Salesforce? [duplicate]

In Salesforce, I have a report that has more than 2000 records (40000 rows). When I am trying to get that report via API I am getting only 2000 rows. It seems there is a limit of 2,000 results that ...
user avatar
0 votes
1 answer
113 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&...
user avatar
-2 votes
1 answer
50 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{ ...
user avatar
1 vote
0 answers
161 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 ...
user avatar
  • 111
1 vote
1 answer
182 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....
user avatar
0 votes
1 answer
27 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 ...
user avatar
0 votes
1 answer
35 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 ...
user avatar
1 vote
1 answer
36 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....
user avatar
  • 13
0 votes
0 answers
75 views

Seeking Normalize class equivalent in Apex [duplicate]

The below is feasible in Java. Is there a way to do the same in Apex? String subjectString = "öäü"; subjectString = Normalizer.normalize(subjectString, Normalizer.Form.NFD); String ...
user avatar
  • 377
0 votes
1 answer
45 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?
user avatar
0 votes
1 answer
63 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.
user avatar
1 vote
0 answers
80 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 = ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
34 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 ...
user avatar
0 votes
1 answer
328 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 ...
user avatar
0 votes
1 answer
28 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 ...
user avatar
0 votes
1 answer
84 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 ...
user avatar
  • 1
0 votes
2 answers
182 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: ...
user avatar
0 votes
2 answers
54 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) { ...
user avatar
  • 3
0 votes
1 answer
47 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 = ...
user avatar
  • 3
0 votes
1 answer
145 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 ...
user avatar
  • 3
1 vote
2 answers
2k 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.....
user avatar
0 votes
1 answer
483 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 ...
user avatar
  • 150
0 votes
0 answers
95 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....
user avatar
  • 1
1 vote
1 answer
240 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 ...
user avatar
0 votes
1 answer
64 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 ...
user avatar
1 vote
0 answers
28 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 ...
user avatar
  • 1,069
0 votes
2 answers
59 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 ...
user avatar
0 votes
1 answer
207 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,...
user avatar
  • 1
0 votes
1 answer
140 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 ...
user avatar
4 votes
1 answer
1k views

how to call NodeJS from apex using Evergreen function

Salesforce has recently announced the Evergreen serverless functions. Information about the Evergreen can be found: https://developer.salesforce.com/blogs/2019/11/introducing-salesforce-evergreen....
user avatar
  • 358
1 vote
1 answer
445 views

Connecting to pushtopic event via Java Client via Proxy

I am trying to run the emp connector sample provided by Salesforce. When i tried running the sample, i was getting socket timeout. After investigating, i realized that our company is behind firewall ...
user avatar
  • 79
3 votes
0 answers
502 views

Force.com Architecture Whitepaper

Are there any other technical resources besides this whitepaper that describes how things work under the hood at SFDC? The Force.com Multitenant Architecture PDF version
user avatar
  • 1,828
2 votes
0 answers
60 views

Salesforce JPA Provider

I'd like to know if there's a JPA Provider for Salesforce. I've seen that java-sdk has it but it's no longer maintained https://github.com/forcedotcom/java-sdk The end goal is to use hibernate to ...
user avatar
  • 121
1 vote
1 answer
66 views

Trouble Installing JDK on Mac for VSCode (SFDX)

I'm trying to do the Apex Replay Debugger trailhead, which requires JDK 8. When I install the JDK on my Mac, the installer tells me it went into /Library/Java/ directory. However, when I look in that ...
user avatar
0 votes
1 answer
44 views

Ant logs from deployment and validation in java app

I have a problem with logs from ant command. When I run command in CMD i see step by step progress of deployment or validation but when I execute the same target in my java app I do not see mentioned ...
user avatar
0 votes
1 answer
71 views

Variable remains empty after initialization

Simple Apex (Java actually) question, after I initialized the variable 'a' in a constructor, I tried to access it with a different method but it remains null. Class FirstClass{ String a; ...
user avatar
  • 1,431
1 vote
1 answer
1k views

When using the extensions for VSCode and OpenJDK installed using homebrew, how can I find the Java Home and set it correctly?

While this question and answer looks more like a Java-related question, I think that this can help people starting with the Salesforce VSCode extensions and having this particular scenario (using ...
user avatar
0 votes
0 answers
109 views

Populate fields from Contact onto Opportunity when a "New Opportunity" button on contact is Clicked

I created a button on Contact which is supposed to create a new opportunity, populate fields and create an Opportunity Contact Role on Opportunity when a Sales Rep clicks on New Opportunity Button. ...
user avatar
0 votes
1 answer
100 views

Error : exceptionCode='INVALID_TYPE' exceptionMessage='Must send a concrete entity type.'

private static void createCustomer() { System.out.println("Creating"); Customer__c[] createCust = new Customer__c[5]; try { Customer__c customer = new Customer__c();...
user avatar
  • 56

1
2 3 4 5
8