• kamal
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies

I Have requirement in which i need to send a email to a public group from an apex class.

 

Any pointers will be helpful

 

Thanks in advance  

  • October 20, 2009
  • Like
  • 0

1)I have a s-control with a button. On clicicking on this button it should display the UI formed by another s-control.

 

2) What are the different ways i can know whether an apex triggered at the scheduled time or not.  

  • June 15, 2009
  • Like
  • 0

I Have requirement in which i need to send a email to a public group from an apex class.

 

Any pointers will be helpful

 

Thanks in advance  

  • October 20, 2009
  • Like
  • 0

1)I have a s-control with a button. On clicicking on this button it should display the UI formed by another s-control.

 

2) What are the different ways i can know whether an apex triggered at the scheduled time or not.  

  • June 15, 2009
  • Like
  • 0
I am quite new to salesforce development.  I wonder if salesforce provides API for java ?  Namely, it provides some jar files which I can add them into project build path, and then  I can call some method by this API ?  
  • June 02, 2008
  • Like
  • 0
Hi All,

I have my Force.com IDE created and I would like to create classes that allow me to insert/update /delete data in salesforce database. Should I create just an Apex Class? Is it enough?

Thanks
Cris.
I am new to salesforce. I am trying to log in to the salesforce server using Java. I read the Webservices API page and the cookbook and was able to write the following code. I used the samples given on the website.
Code:
package org.salesforce.samples;

import java.io.BufferedReader;
import java.io.IOException;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.sforce.soap.partner.LoginResult;
import com.sforce.soap.partner.SessionHeader;
import com.sforce.soap.partner.SforceServiceLocator;
import com.sforce.soap.partner.SoapBindingStub;
import com.sforce.soap.partner.fault.ApiFault;
import com.sforce.soap.partner.fault.LoginFault;

public class PartnerSamples {

 private SoapBindingStub binding;
 private LoginResult loginResult = null;
 private String un = "";
 private String  pw = "";
  
        static BufferedReader rdr = new BufferedReader(new java.io.InputStreamReader(System.in));

 public PartnerSamples() {
 }

 public static void main(String[] args) {
  PartnerSamples samples1 = new PartnerSamples();
  samples1.login();
 }

 String getUserInput(String prompt) {
  System.out.print(prompt);
  try {
   return rdr.readLine();
  } catch (IOException ex) {
                    System.out.println(ex);
  return null;
  }
 }
 private boolean login() {
  un = getUserInput("Enter user name: ");
  if (un.length() == 0) {
   return false;
  }
  pw = getUserInput("Enter password: ");
  if (pw.length() == 0) {
   return false;
  }
  System.out.println("Creating the binding to the web service...");
         try {
   binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
  } catch (ServiceException ex) {
   System.out.println("ERROR: createing binding to soap service, error was: \n"+ ex.getMessage());
   System.out.print("Hit return to continue...");
   return false;
  }
  binding.setTimeout(60000);
  System.out.println("LOGGING IN NOW....");
  try {
   loginResult = binding.login(un, pw);
  }catch (LoginFault lf) {
   System.out.println("in 1");
   lf.printStackTrace();
   getUserInput("\nHit return to continue...");
   return false;
  } catch (ApiFault af) {
   System.out.println("in 2");
   getUserInput("\nHit return to continue...");
  } catch (RemoteException re) {
   System.out.println("in 3");
   re.printStackTrace();
   getUserInput("\nHit return to continue...");
   return false;
  }


  System.out.println("\nThe session id is: " + loginResult.getSessionId());
  System.out.println("\nThe new server url is: " + loginResult.getServerUrl());
  SessionHeader sh = new SessionHeader();
  sh.setSessionId(loginResult.getSessionId());
  binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
  return true;
 }
}
I am successfully able to build the code and run it. However when trying to login, i got the java.net.connectException. The complete exception is below.
Code:
init:
deps-jar:
compile:
run:
Enter user name:abc@xyz.com
Enter password:password
Creating the binding to the web service...
LOGGING IN NOW....
in 3
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.net.ConnectException: Connection timed out: connect
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:353)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:1844)
        at org.salesforce.samples.PartnerSamples.login(PartnerSamples.java:73)
        at org.salesforce.samples.PartnerSamples.main(PartnerSamples.java:33)

        {http://xml.apache.org/axis/}hostname:Jedi

java.net.ConnectException: Connection timed out: connect
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:1844)
        at org.salesforce.samples.PartnerSamples.login(PartnerSamples.java:73)
        at org.salesforce.samples.PartnerSamples.main(PartnerSamples.java:33)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:353)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)

        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        ... 12 more
Hit return to continue...
 
I am using Java 1.6 and have just added the jar files for axis on the path. I am not running axis or tomcat in the background as i think i am trying to connect to the server on salesforce so i do not need to. Am i right in assuming this? The error is  caught in third catch block which is for remote exception. I am not able to understand what can i do to make it work.  Thank you in advance and sorry for the long post.
 
Shekhar
 
 
 


 
Hi Folks,
                   
                        I have  a WSDL file ,when i gernerate a  class files from this it's geberated 21 classes and i want to run the following example which include import as follows(it is a example from apex code development pdf document):

package com.doc.samples;
import java.io.*;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.sforce.soap.enterprise.*;
import com.sforce.soap.enterprise.fault.ExceptionCode;
import com.sforce.soap.enterprise.fault.LoginFault;
import com.sforce.soap.enterprise.sobject.Contact;

the imports which are in red not recogined bcz these classes are not in the jar file which i have extracted from WSDL file So what iam thinking is may be i have a wrong apex wsdl file , so can any one suggest me to download the correct apex wsdl file  to generate all classes include which are marked in red! i have a 1 month subscription developer account.


Regards,
Rajeshwar.
hi
 
i have added some picklist  value like software1,software2  using metadata api
into custom picklist (SLA) of Account object.
 
when i see my apex explorer i am able to see those two values(software1,software2) in SLA__C table.
but when i create a new account i am not able to see those two values in
SLA picklist.
 
So can anybody tell what could be the problem.
 
Another thing can we add picklist value into standard picklist of standard object
using metadata api.
 
 
 
 
 

Hi,

I am trying to login to salesforce using api's.I am new to the salesforce.I am trying the sample code given in apex api doc.I am getting java.net.ConnectException.

I am using JDK 5.0 ,axis 1.4,apex api's 9.0 and tomcat 5.5.20

The stack trace is given below. Please help me to fix this.

 

An unexpected error has occurred: ; nested exception is: 
 java.net.ConnectException: Connection timed out: connect
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.net.ConnectException: Connection timed out: connect
 faultActor: 
 faultNode: 
 faultDetail: 
 {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
 at java.net.Socket.connect(Socket.java:507)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:546)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:349)
 at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:69)
 at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
 at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
 at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:2595)
 at org.honeywell.Samples.login(Samples.java:81)
 at org.honeywell.Samples.run(Samples.java:325)
 at org.honeywell.Samples.main(Samples.java:36)

 {http://xml.apache.org/axis/}hostname:IE10DTJ8FNM1S

java.net.ConnectException: Connection timed out: connect
 at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:2595)
 at org.honeywell.Samples.login(Samples.java:81)
 at org.honeywell.Samples.run(Samples.java:325)
 at org.honeywell.Samples.main(Samples.java:36)
Caused by: java.net.ConnectException: Connection timed out: connect
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
 at java.net.Socket.connect(Socket.java:507)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:546)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:349)
 at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:69)
 at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
 at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
 at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
 ... 13 more


 Thanks,

Naresh.T

Hi,

How can i add new values in picklist using office toolkit? I can read the values but i want to add new values in it.

Thanx in advance