We’re rewarding the question askers & reputations are being recalculated! Read more.

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
25
votes
1answer
2k views

What is Apex built on?

Earlier today, a coworker asked what exactly Apex was. My lazy answer for those unfamiliar with Salesforce development is usually "it's like Java, but for Salesforce.com," to which he replied "is it ...
21
votes
1answer
2k views

Does Apex transpile into Java?

We know that the Apex syntax is very similar to Java. I have observed that on some occasions, while running some Apex code, you may get a Java exception. I assume that Apex runs on Java. But my ...
14
votes
3answers
6k views

Salesforce Metadata Api/ Tooling Api to build changesets

I was wondering if it was possible to use any of the API's provided by SF to build an external (C#, Java) application to manage building changesets. Building changesets is very tedious when trying ...
13
votes
2answers
11k views

Can Data Loader run with 64-bit Java?

I have uninstalled all old versions of the data loader and installed the newest one: 36.0.0 I cleaned up all Java stuff on my 64-bit Win 7 machine and there's only one version left, it's this version ...
9
votes
3answers
13k views

Pass a string variable from controller into the Javascript function

I have a method which returns a Yes or No String depending on it's outcome. The method is inside a standard controller extension. How do I pass the returned String into a function on the page in ...
9
votes
3answers
751 views

Functional programming utilities in apex

I've heard that in javascript world there is an emergent ecosystem of functional libraries (like lodash, rxjs but also es6 promise) and also in the java world (guava or Java8 with lambdas). Is there ...
8
votes
2answers
5k views

Create a record in an object with lookup fields through java soap

I am pretty new with Salesforce and I am doing an integration where I have to update Salesforce with data from a Business System. I have a problem when trying to create new records in an object with ...
8
votes
1answer
4k views

REST API: How to update active values for picklist?

I need to update the Picklist values for a custom field on a custom object. I have already populated the Available Values via the Enterprise and Metadata Java APIs, but now I need to move the newly ...
8
votes
0answers
279 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 ...
7
votes
1answer
11k views

Using Java and Spring to integrate with Salesforce REST APIs

I want to send information from our webapp (using Java and Spring) to the Salesforce REST APIs. I'm looking for an up-to-date example of how to use Spring Security to authenticate with OAuth to the ...
7
votes
1answer
2k views

Unable to upload an Attachment - Bulk API

I'm using Bulk API to upload attachments and getting an error: InvalidBatch : Failed to parse CSV header. Number of Records Processed: 0 While I'm getting following error at the Salesforce ...
7
votes
1answer
295 views

How do I use Salesforce connector with a Spring component?

I am using Mule standalone 3.4. I am trying to create a flow using the Salesforce connector to perform a query operation and then pass the payload to a spring component. The result is the component ...
7
votes
1answer
706 views

Updating Profile for Record Types: using Metadata API

So far I'm able to create the Record Type for an object using Java. For the object requiring only 1 Record Type using Java: (the upserts are going fine) - If I'm to create only one record Type per ...
6
votes
2answers
936 views

java.sql.SQLException error caused by OpportunityLineItem DML request

In our Salesforce.com organization, we have a trigger on the OpportunityLineItem object (insert/update), automatically generating OpportunityLineItemSchedule. The product is schedule by revenue, ...
6
votes
2answers
2k views

SOAP webservice connection getting: no access allow to this class

I'm pretty new to salesforce and SOAP but here goes. I've made a connection to my site and then passed in the config to my webservice's object. This goes fine. But then I get this error: com.sforce....
6
votes
4answers
2k views

Oauth for Java native app

I have a Java native app I am trying to implement Oauth for. I have gone thru this article by Pat Patterson: http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com I am a ...
6
votes
1answer
10k views

Displaying date in visualforce force page in required format

I have a date fields which on displaying on VF page displays like 12/10/2012. But i want to display it like December 10, 2012. How can i do it? i am not getting the easy way.
6
votes
1answer
2k views

How to get the content of an existing apex class using metadata api

I was able to get the names of all the apex classes in an org using metadata api with Java public void getApexClasses() throws ConnectionException { ListMetadataQuery[] queries = new ...
6
votes
1answer
105 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 ...
6
votes
1answer
4k views

Multi threading in SOAP API java client

Is it possible to do the multi-threading in java application while talking to Salesforce using SOAP APIs? I tried it myself and it seemed to work fine. But according to http://boards.developerforce....
5
votes
2answers
2k views

Capture Salesforce Outbound Message with a Java SOAP Listener

I would like to send the modified data on an object to an external system. For this I am thinking to use workflow based Outbound Message option. What I understand, the required endpoint url will be ...
5
votes
3answers
19k views

How to set TLS Version in Java SOAP API

I am trying to connect to a new org using the Java SOAP API and am getting the following error: [UnexpectedErrorFault [ApiFault exceptionCode='UNSUPPORTED_CLIENT' exceptionMessage='TLS 1.0 has been ...
5
votes
1answer
2k views

Trying to get SymbolTable of an Apex class and get null

I'm quering Apex classes using Tooling API QueryResult queryResult = toolingConnection.query("select Id, ApiVersion, Name, NamespacePrefix, SymbolTable, Body from ApexClass where NamespacePrefix = ...
5
votes
2answers
7k views

Using Salesforce Partner API from community portal

I've created a custom button on the opportunity layout which calls out to an external java app. It passes the session id and the partner API URL. The external app then creates a SOAP binding (...
5
votes
2answers
1k views

Retrieving All column names from a DataExtension

I am retrieving data from a data extension using RetrieveRequest. Following is a snippet of my approach: RetrieveRequest retrieveRequest = new RetrieveRequest(); retrieveRequest.setObjectType(...
5
votes
1answer
294 views

Which way to update apex class through API is preffered: MetadataContainer in Tooling API or compileClasses in Apex API?

I need to save some Apex classes through API in java and this question confused me: In documentation for the Tooling API I found an example how to update Apex class using MetadataContainer. This ...
4
votes
3answers
424 views

Moving Salesforce data into Heroku Java app for LDV processing?

I have read a few blog posts about moving parts of an app into a Ruby Heroku app, but no example for moving data between a Salesforce org and a custom Java app on Heroku. Do you know of any in posts ...
4
votes
2answers
2k views

Invalid Date format from Database

Trying to insert a Contact from an Oracle Database: Contact Database Entity: @Temporal(TemporalType.DATE) @Column(name="DOB") private Date dob; Contact SOAP SObject set Birthday: Calendar ...
4
votes
1answer
449 views

Getting salesforce instance URL from Java

Is there a way for me to get salesforce instance URL from Java? I was looking for something similar to System.Url.getSalesforceBaseUrl() in Apex, but I couldn't find anything suitable in Metadata or ...
4
votes
1answer
1k views

Passing custom model to Apex REST custom endpoint

I have a custom APEX REST point /organization-contacts/* that accepts an array of queries to run. This is to try and find matching contacts (based on phone number in this example) in "batch". I ...
4
votes
1answer
920 views

Can I save a new Apex class using Tooling API in java?

Is it possible to create a new Apex class using Tooling SOAP API in java? When I'm trying to do that I get ApiFault exceptionCode=’INVALID_TYPE’ exceptionMessage=’This type of object is not ...
4
votes
1answer
3k views

How to retrieve a value from a parent field with SOQL via partner API in java

I have a parent-child relationship with timesheets relating to users. I am trying to retrieve an Employment ID field from the parent record with SOQL and this is my query, where the UserID is a field ...
4
votes
1answer
456 views

Is there a way to tell if a HTML hex colour is light or dark in Apex

I have a Visualforce Colorpicker that allows users to set a background-color. I have access to this in Apex as a string, e.g. '#FF0000'. I want to know if this String is a dark color or a light ...
4
votes
1answer
474 views

How to setup Tooling Api in Java Application?

I am developing a Java application that should be able to connect to any Salesforce org and use the Tooling Api. Salesforce provides a WSDL but as I understand it is org specific, correct ? Could ...
4
votes
3answers
1k views

Return custom event.message using Javascript remoting?

Short version: Can I return my own messages in the javascript remote event.message object? Long version: I use a javascript remote call to perform an ajax search. This is the code (pretty much ...
4
votes
1answer
3k views

Call Restful SFDC service from Java

I'm still working on getting the authentication working but having issues. I have been getting a 401 unauthorized error. All of the items I have hidden I am sure are correct values UNLESSS I need to ...
4
votes
1answer
882 views

AllOrNoneHeader for Bulk API

I am trying to switch off Autocommit feature by using AllOrNoneHeader in Bulk API implementation through JAVA. I have searched over internet but see only example of implementing it for SOAP based ...
4
votes
1answer
168 views

How expensive is isDone() in java metadata api

I found the following code example online: long waitTimeMilliSecs = ONE_SECOND; // After the create() call completes, we must poll the results of the checkStatus() // call until it ...
4
votes
1answer
237 views

Salesforce Streaming API: configure Salesforce notification triggers for streaming

I'm trying to subscribe on notifications from salesforce using Streaming API. So I've done: I've created streaming channel I used java client I've generated events via REST API All this steps ...
4
votes
2answers
432 views

How to use Name Object

I am using the Java API and trying to create an Attachment with a reference to the Parent external Id field. The setParent() method takes a Name object as the parameter. For what I read, the Name ...
4
votes
1answer
500 views

Error when trying to create an User-Initiated object (ETEmailSendDefinition)

I'm trying to use fuelsdk-0.999.jar and fuelsdk-0.9999.jar (both gave me the same error) in a Java projetc downloaded from https://github.com/ExactTarget/FuelSDK-Java/releases and when I try to call ...
4
votes
0answers
436 views

Data Loader does not open on OS X El Captain

Does anyone have similar issue opening Data Laoder on MAC OS X El Capitan?
4
votes
0answers
433 views

Override PartnerAPI ClassLoader

We have exported as Runnable JAR (Extract required libriries into generated JAR option) our proyect (which has dependecies the fuelsdk and axis). So, there are some classes which read properties ...
3
votes
2answers
541 views

Need some help with jquery plugin select2 and VF page

I am trying to use jquery plugin select2 in my VF page to make the select look better. For some reason i cant get it to work. I have loaded in all the js and css as static resources. There is no ...
3
votes
3answers
6k views

Removing Item From List by Index Causes Index to Change

As I'm attempting to remove an item from a List by the items respective index value I'm realizing (in a "going nuts" sort of way), that again because of pass by referencing I'm getting unexpected ...
3
votes
2answers
5k views

How to add a field using the SOAP or other API

I am using the SOAP API to load data for multiple SObject types into a completely new Developer sandbox. I have manually added external ids to many of the objects through the native interface so that ...
3
votes
2answers
375 views

How to communicate with Salesforce without WSDL?

We have a platform which is programmed in Java. The problem is, every time the WSDL changes(happens more often), the platform crashes. Is there a way to communicate to Salesforce without the WSDL? Or ...
3
votes
2answers
185 views

Why (referenceTos[0] != null) check is being performed in following code?

I was going through a salesforce.com developer documentation code // Iterate through the list of describe sObject results for (int i=0;i < describeSObjectResults.length; i++) { ...
3
votes
1answer
266 views

Force IDE 2 BETA not working due to java.lang.NullPointerExceptions

I'm using the old eclipse-based Force IDE for some of my task, mostly deployments. I've seen that there is a new BETA Version of Force IDE 2 based on Salesforce DX here: https://developer.salesforce....
3
votes
1answer
233 views

How can I get system apex classes using SOAP API (or any other API)

Is it possible to get a list of system apex classes like String, Datetime etc. and a list of their methods, fields etc. using soap or metadata or tooling api in java?