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
1
vote
1answer
513 views

HTTP Callout from salesforce to private server URL(VPN connected)

Can we hit a private server URL with HTTP request from Salesforce ?? or the server should always be public. I have make the Post callout which was written in Rails (hosted on Private server- VPN ...
0
votes
1answer
113 views

Salesforce SOAP API doesnt have setRecordTypeId method when using enterprise WSDL

I am using SOAP API to post leads in salesforce i want leads to be of specific record type but im not getting any option to set the record type of lead.Please Find code below. ...
0
votes
1answer
1k views

can i pass variable values from ampscript to javascript?

i have a cloud page in marketing cloud. In cloud page, I am using ampscript and javascript both. Can i pass variables values from my ampscript to javascript directly? I have already tried this ...
0
votes
1answer
249 views

Getting “Nesting of semi join sub-selects is not supported” when submitting query

I'm using Java to query SF, using the aPI version 33.0. I'm trying to submit the following query SELECT Id, EODBID__c from Account where Id in (Select AccountId from Opportunity where RecordTypeId ...
0
votes
1answer
235 views

How to get LastModifiedDate of Custom Field or Custom Label by Metadata API in Java?

How to get LastModifiedDate of Custom Field or Custom Label by Metadata API in Java? Edit: I found a link: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm?...
0
votes
0answers
104 views

Fetch Metadata from Salesforce using Tooling API objects [duplicate]

I am building a tool in Java to fetch all the metadata from Salesforce using the Tooling API. For Ex: I want to fetch all the profiles details including object-permission, field-premission, ...
0
votes
1answer
45 views

SOAP API v42: Edit “Default Organization Level Values” of Custom Settings

How to edit Default Organization Level Values of Custom Settings in Soap API in Java? I mean, how to edit... Setup > Build > Develop > Custom Settings > [Any CS Object] > Manage > ...
0
votes
1answer
330 views

How to get LIST of Custom Settings by API with Query Condition?

I want to get list of available Custom Settings using SF API in Java. I mean Setup > Build > Develop > Custom Settings > Get that list Additionally, I need to have got the condition in ...
1
vote
1answer
173 views

How can I create a queue group via the API

So in testing, I've figured out that a queue is a type of Group. I'm trying to POST a new group, then change its Type from "regular" to "queue", but in doing so, I get this error message: Unable to ...
0
votes
1answer
56 views

How to get opportunity history value and convert it to pdf?

im new in salesforce programming.. I made an pdf report (button) on opportunity.. I can get the opportunity object field value (and opportunityLineItem) and convert it to pdf.. but down below the ...
0
votes
1answer
125 views

Why deploy.zip file does not deploy metadata when archived using java.utils.zip?

I have created deploy folder with all correct metadata definitions. If I compress the folder using java program and try to deploy it using DeploySample java code, get success in console but no ...
0
votes
1answer
524 views

Automating CSV Uploads into Einstein Analytics with Wave DatasetUtils

According to this Trailblazer Community Post, the Wave DatasetUtils tool can be used to automate csv uploads into Einstein Analytics (the user lists this option alongside automating via Apex). ...
1
vote
1answer
71 views

Can I use enterprise.jar/metadata.jar generated from one org to establish connection with different org?

I have generated jar from enterprise.wsdl for some java development. I wonder if i could use the same jar to establish connection to different salesforce org having different enterprise.wsdl file? ...
1
vote
1answer
118 views

Do we have `setQueryOptions` for tooling API?

The Symbol table is only queried through tooling API. Do we have an option to set setQueryOptions when doing that, or similar way of setting batch size to do that. Because when running query() and ...
1
vote
1answer
168 views

Identity URL always throwing Missing_OAuth_Token?

HttpClient httpClient = new HttpClient(); PostMethod post = new PostMethod(environment); post.addParameter("code", code); post.addParameter("grant_type", "authorization_code"); post....
1
vote
1answer
325 views

Tooling API : how to query on Salesforce Standard classes?

How can I query and get Standard Apex classes and their Symbol table via tooling API or Partner API? For eg: getting a custom Apex Class : String apexClassBodytooling = "SELECT Id, Name, SymbolTable ...
1
vote
1answer
31 views

How do you determine how many results are in the current query batch?

We're using Java 8, v 33.0 of the SF API and trying to build an endpoint in Java to iterate over results. I have this import com.sforce.soap.enterprise.QueryResult; ... QueryResult ...
1
vote
2answers
164 views

ToolingConnection's query method throwing com.sforce.ws.ConnectionException: Failed to load class: com.sforce.soap.tooling.InvalidSObjectFault

I'm using Salesforce Tooling API in Java code and I am able to use create method of ToolingConnection. Bellow code is creating an apex class successfully. I'm getting exception when using query method ...
1
vote
0answers
552 views

calling salesforce rest api from java to create leads

I am writting below code to create leads in salesforce crm through its rest full api.But it is giving error 401.Can any one help me to sort out this issue. static String generateHeader() { ...
0
votes
1answer
426 views

JSONGenerator issue

I want to return a JSON from my Apex Rest web service. There is a list of objects I must return. If I just make the return type of the method as return myCustObjList Edit here goes the datatype: ...
0
votes
1answer
111 views

W/I Test.SalesForce.com Sandbox, SOAP endpoint call using Java EnterpriseConnection.describeGlobal() NOT returning RemedyForce “BMCServiceDesk__x”

Within Test.SalesForce.com Sandbox, SOAP endpoint call using Java EnterpriseConnection.describeGlobal() NOT returning any RemedyForce / "BMCServiceDesk__xxxx" objects Background Information 1) I am ...
0
votes
1answer
201 views

Updating FLS using metadata API through java

I wanted to update FLS for the custom fields in Profile level. @datasert- Thanks for guided me on the right path, I have tried with the code below but after executed the code, changes are not ...
0
votes
1answer
502 views

How to implement redirect login with Java + AngularJS [closed]

For example site: aside.io, when we click Sandbox login, it takes you to test.salesforce.com and then when you enter your user name and password it authenticates and redirects to the aside.io with the ...
1
vote
1answer
113 views

trying to retrieve Symbol Table through tooling API takes too long

I am trying to retrieve SymbolTable from Tooling API, but it takes too long to retrieve that. Also like when I try to access the SObject from the ToolingAPI package, I am not getting any option like ...
1
vote
1answer
346 views

Cannot retrieve full class list from the org using tooling API?

I am using partner api to get the list of classes in salesforce. But issue is that at a time we can only get 2000 classes, I tried using a while loop to pass the list of classes already queried but ...
-2
votes
1answer
202 views

Convert Java encryption code to Apex

I would like to translate this method into java for apex. Tried in different ways and could not :/ public static String encodeString(String stringToEncode, String secret) throws Exception { byte[]...
0
votes
0answers
387 views

How to use MetadataService class using Metadata API through SOAP

I have a requirement to grant FLS to the certain fields on profile level. I want to achieve this using Salesforce Metadata API thru java. I came across the below code for updating FLS using ...
0
votes
2answers
160 views

Receiving API Error

I'm currently using CentOs 6.9 and I'm trying to run the program Salesforce2Hadoop on Terminal. When I run the initial data import using the init command, I came across this error: Exception in ...
2
votes
1answer
259 views

Setting a cookie in a canvas app?

I have a Java application that sets a cookie: Cookie keks = new Cookie("Demo","WeLoveCookies"); keks.setHttpOnly(true); keks.setSecure(true); keks.setPath("/"); response.addCookie(...
6
votes
1answer
112 views

Is there a zero-downtime way to rotate the server credentials used by force-wsc?

I use force-wsc to connect to the SOAP API with a username and password/security token in production. As a best practice, I rotate the password (and therefore the security token) on this server ...
0
votes
1answer
236 views

Metadata API file based retrieve and deploy calls

I want to build an java application where my code take package.xml and retrieve all metadata. Well this one is done using Java Example code given by Salesforce. Now I need to unzip that zip and do ...
1
vote
1answer
650 views

Destination URL not reset. The URL returned from login must be set in the SforceService

I am still a little new to web services and could use some help. Currently I am going through some code that was implemented before I started at this company. The code is trying to connect to ...
0
votes
1answer
196 views

Issue with Connected-App. Java-Salesforce Rest API

I am getting an issue from my local java application running at http://localhost:8080. When I enter this address inthe browser, I am being redirected to a login.salesforce.com, but I see a blank ...
0
votes
1answer
334 views

Java - Creating BulkConnection object with Oauth token

I have successfully been able to create a bulk API connection with the following code that calls the SOAP auth endpoint: ConnectorConfig partnerConfig = new ConnectorConfig(); partnerConfig....
1
vote
1answer
413 views

[FuelSDK Java 1.2.1][ java.lang.IllegalStateException: Already connected] When using constructor of ETClient

This is my example code. It can run in local machine, but when deploy to EC2 instance of Amazon AWS, error was occured. public class SalesforceMarketingCloudDBService { private static final Logger ...
2
votes
0answers
116 views

Salesforce Java Streaming Client filtered subscription

I am subscribing to a push topic from a Salesforce Streaming java client that uses the cometd and bayeux libraries. I found this page which says that filtered subscriptions are supported in streaming ...
0
votes
1answer
35 views

Account BirthDate is one day off (Java to Salesforce API)

When I'm inserting a date from my Java code to the Salesforce it shows one day off in Salesforce. Example my Java date is 24. January 2000, and Salesforce say it is 24., February 2000. Java: Date ...
0
votes
1answer
20 views

Account getAccountRecordTypeId

I want to ask my Salesforce for Account ID, based on Account Name.The problem is what am I going to put into the "where" part of my query? My interface: Account getAccountRecordTypeId(String ...
0
votes
0answers
593 views

REST API: Insert or Update Blob Data

Looking to the community for some help on this one.. I've been using postman to deliver a multipart message with the binary data to upload a document to a document folder through the REST API. The ...
0
votes
1answer
45 views

Exception occurs trying to delete a Shared Content Area using FuelSDK

I keep getting an error while trying to delete a Content Area using the SOAP API. I use the same base code to delete Emails and DataExtensionRows, but keep getting errors when deleting Shared Content ...
8
votes
0answers
290 views

Make custom, in-memory “Lightning Data Service” work

Lightning Data Service is great. Multiple components are magically linked to database records. When records change in the db component show that change. Imagine this to work without saving change to ...
1
vote
0answers
98 views

Help Converting a Java Crypto class over to Apex Crypto

I have a java class for generating a token and I am struggling on converting it to apex. Below is the code. Any pointers would be appreciated! Here are the two methods in the java class that get ...
0
votes
1answer
46 views

How to Manage Dated Exchange Rates and Currencies using Web Service Connector

Is it possible to update the Dated Exchange Rates and Currencies using Web Service Connector and Java? If it is, kindly give links or sample codes for references. I have searched on different sites ...
1
vote
0answers
476 views

Error authenticating to Force.com: 400

I have developer account on salesforce.com. Using Java, I am trying to connect, but I am getting a 400 error. I tried to pass a token as well as without. package src; import java.io.IOException; ...
1
vote
1answer
132 views

run assignment rule from javascript button

I have a requirement to run case assignment rule from javascript. I used the below code but the assignment rule does not run. {!REQUIRESCRIPT("/soap/ajax/40.0/connection.js")} {!REQUIRESCRIPT("/soap/...
1
vote
2answers
282 views

Is a Java SDK like JSforce available?

I am working to integrate my Java application with Salesforce Service Cloud. Searching about it, I saw that there is a very nice JS library, JSforce but I could not find anything similar for Java. ...
0
votes
1answer
854 views

Salesforce Partner WSDL Java Client

I'm creating a Java WS Client (Salesforce Partner WSDL) and following the Salesforce "Setting Up Your Java Developer Environment" document. It recommends installing the Web Services Connector (WSDL-...
0
votes
0answers
89 views

Equivalent method for Java class HttpEntity entity = new StringEntity(<any string>); in Salesforce

I am trying to find equivalent Salesforce class for the following code. HttpEntity is a Java class. HttpEntity entity = new StringEntity(msg); httpPost.setEntity(entity);
0
votes
1answer
2k views

Download and save contentVersion file JAVA

Please help me with download contentversion of PDF and save to file in java. I have a problem with base64. RestAPI return content in base64 but when I save it to file I have a blank page when I ...
2
votes
0answers
190 views

Porting Java to Apex: libphonenumber

To perform back-end validation and formatting of phone numbers, I am interested in porting the Java version of Google's open-source libphonenumber library to Apex. If you have ported a Java library to ...

1 2 3 4 5 8