• AWilkinson
  • NEWBIE
  • 0 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 15
    Replies
Is there anyway one could add more than 7 custom fields to their accounts database? thank you.

my next question, i want to be able to set the account number the api gives me into the account number field, I have set the account number as "ID" but when i try to display it, it comes up blank. (because the definition of ID is defined after the input, but I cannot put it infront of it because it comes up with many errors) does any have code to display the account number in the correct field?

this is what my code looks like:

        record[9] = new MapEntry();
        record[9].setKey("accountNumber");        //Account Number
        record[9].setValue(ID);

Element value = null;
        value = (Element)binding.insert("account", record);
        ID = XPathAPI.selectSingleNode(value, "/valueMap/id/text()").getNodeValue().toString();
        System.out.println("Inserted new account, id: " + (ID) + ", with a name of AWilkinson");
        System.out.println("");

 

If i could bring the Element value=null part above the record[9] new MapEntry() part, it would display fine, but it wont resolve symbol "record"

if anyone has code they could let me try, that would be greatly appreciated! thanks

Is there a way to add contacts through the java api coding?

if so, could you post the coding to perform the action?

thank you.

Message Edited by AWilkinson on 08-01-2003 08:35 AM

I was wondering where I could find information on the following:

1) How to assign responisbilities for partners (needs read, write, edit, but not delete controls)

2) How to add custom fields to Salesforce.com

 

thanks!

Message Edited by AWilkinson on 07-24-2003 08:25 AM

You are connecting to http://na1.salesforce.com/servlet/servlet.SoapApi
SEARCH RESULTS
java.lang.NullPointerException
 at SForce.search(SForce.java:266)
 at SForce.main(SForce.java:394)
Process terminated with exit code 0

 Object result = null;
            SOAPEnvelope respenv = response.getSOAPPart().getEnvelope();
            respbody = respenv.getBody();
         for (Iterator i = respbody.getChildElements(); i.hasNext() {
             SOAPElement element = (SOAPElement) i.next();
             if (element.getElementName().getLocalName().equals(RETURN)) {
                 for (Iterator j = element.getChildElements(); j.hasNext() {
                        SOAPElement next = (SOAPElement) j.next();
                    result = test.api.SForceUtil.getObject(next, this.typeName);

in this section of the code, I am returned with a null pointer exception. I remember reading that others had this same problem, what was the solution?

when i run SForce.java and enter my user name and password, this message is returned:

tns
tns:headerStruct
tns
tns:headerStruct
tns
tns:headerStruct
return                               <------------- if incorrect user name/pass entered, return changes to "fault"
No results returned

would anyone know my problem? thanks

Message Edited by AWilkinson on 07-16-2003 08:41 AM

Message Edited by AWilkinson on 07-16-2003 08:52 AM

my next question, i want to be able to set the account number the api gives me into the account number field, I have set the account number as "ID" but when i try to display it, it comes up blank. (because the definition of ID is defined after the input, but I cannot put it infront of it because it comes up with many errors) does any have code to display the account number in the correct field?

this is what my code looks like:

        record[9] = new MapEntry();
        record[9].setKey("accountNumber");        //Account Number
        record[9].setValue(ID);

Element value = null;
        value = (Element)binding.insert("account", record);
        ID = XPathAPI.selectSingleNode(value, "/valueMap/id/text()").getNodeValue().toString();
        System.out.println("Inserted new account, id: " + (ID) + ", with a name of AWilkinson");
        System.out.println("");

 

If i could bring the Element value=null part above the record[9] new MapEntry() part, it would display fine, but it wont resolve symbol "record"

if anyone has code they could let me try, that would be greatly appreciated! thanks

Is there a way to add contacts through the java api coding?

if so, could you post the coding to perform the action?

thank you.

Message Edited by AWilkinson on 08-01-2003 08:35 AM

Hi,

What key words to look for in exception to know that the session expire and need to relogin

Thanks.

peilei

 

  • July 24, 2003
  • Like
  • 0

I was wondering where I could find information on the following:

1) How to assign responisbilities for partners (needs read, write, edit, but not delete controls)

2) How to add custom fields to Salesforce.com

 

thanks!

Message Edited by AWilkinson on 07-24-2003 08:25 AM

when i run SForce.java and enter my user name and password, this message is returned:

tns
tns:headerStruct
tns
tns:headerStruct
tns
tns:headerStruct
return                               <------------- if incorrect user name/pass entered, return changes to "fault"
No results returned

would anyone know my problem? thanks

Message Edited by AWilkinson on 07-16-2003 08:41 AM

Message Edited by AWilkinson on 07-16-2003 08:52 AM

i've downloaded the java toolkit and set everything up as instructed. when the sample program runs, i get an error after the login:

SEARCH RESULTS
java.lang.NullPointerException
        at test.api.SForce.search(SForce.java:264)
        at test.api.SForce.main(SForce.java:399)

i put a statement in the SForce class

           for (Iterator j = element.getChildElements(); j.hasNext() {
                     SOAPElement next = (SOAPElement) j.next();
                     result = SForceUtil.getObject(next, this.typeName);
                    System.out.println("result is"+result);
                 }

which prints out "result is null" when the sample is run

my understanding is that the sample searches for accounts with the word "test" in some field. i've put the word "test" in the website field of 3 accounts.

so i'm wondering what the problem is. has anyone got the toolkit to run properly? what needs to be put in the account fields?

Message Edited by pninth on 07-01-2003 10:29 AM

Issue # 1

The XML-RPC java Library provided by SalesForce.com does not support a common method of

calling applications thru a proxy. The standard java code snippet normally allows

applications to converse outside our proxy. This code fragment works with our proxy.

The code is:

System.getProperties().put( "proxySet", "true" );

System.getProperties().put( "proxyHost", "gateway.xyz.net" ); //This is the proxy entry in the Browser.

System.getProperties().put( "proxyPort", "80" );

String password = "userid:password";

BASE64Encoder enc = new sun.misc.BASE64Encoder();

String encoded = enc.encode(password.getBytes());

connection.setRequestProperty( "Proxy-Authorization", "Basic " + encoded );

 

Issue #2

The XMLRPC library provided by SalesForce.com has modifications that are not in the

public domain apache.org XMLRPC jar file. The Apache Library Standard does not have:

setSessionId(). This prevents us from making changes to the public XMLRPC

source (.java) to handle Proxies as mentioned above.

 

  • June 27, 2003
  • Like
  • 0