• SFNew
  • NEWBIE
  • 25 Points
  • Member since 2009

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

Hello All,

              I am not entirely sure if this question was already answered. I am asking this since I could not find a solution in the board as much as I searched for. I'd like to know if its possible to view my account's security token after I log in. In cases where I write a client application that connects to SF, if the token is deleted or needs or accidentally modified, so far I've always reset the security token and used the new one. Just wondering if it could be obtained anywhere from my account's "My personal information" page or anywhere else. Thanks much in advance.

  • August 12, 2009
  • Like
  • 0

Hello All,

              I have developed an axis based client. I'd like to know if the client stub automatically stores a certificate when it is generated or it gets it from the platform everytime the call is made. I believe any client that speaks to a secure server has to have a certificate stored locally in its filesystem. Any help to clarify this is greatly appreciated. Thanks.

  • July 20, 2009
  • Like
  • 0

Hello,

          I am writing a client that updates our orgs data to SF. I am using API. I'd like to know if there is any way to know the object type from SF Id? I get the ID from our DB. I do not want to retrieve an SObject and then know that it is not what I wanted. Any help in this regard is greatly appreciated. Thanks all. 

  • May 13, 2009
  • Like
  • 0

Hello All,

              I am implementing a client using API, to sync our orgs  data with SF. I got the WSDL from prod since they have the updated objects and created those objects in my sandbox. Now I generated the client stubs from the prod WSDL and trying to do some update etc. I am getting the following exception,, I understand theoretically it should be po

// My login stub

SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap(new java.net.URL("http://www.test.salesforce.com/Services/Soap/c/15.0"));
salesforceLoginResult = binding.login(user,passwd); // Erroring out here when I did a trace
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,salesforceLoginResult.getServerUrl());



SessionHeader sessionHeader = new SessionHeader();
sessionHeader.setSessionId(salesforceLoginResult.getSessionId());
sfBinding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader",sessionHeader);

 

Error Message:

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.UnknownHostException: www.test.salesforce.com
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.UnknownHostException: www.test.salesforce.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
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:3047)
at Updater.main(Updater.java:61)

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

java.net.UnknownHostException: www.test.salesforce.com
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:3047)
at Updater.main(Updater.java:61)
Caused by: java.net.UnknownHostException: www.test.salesforce.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
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)

 

ssible to do what I am doing. I'd greatly appreciate if someone could point out if I am doing anything wrong here. 

 

Message Edited by SFNew on 05-03-2009 01:47 PM
  • May 03, 2009
  • Like
  • 0

Hello All,

              I am implementing a client using the API. I am getting the response back from SF as mentioned in the document. i.e. Successful updates have the SF Ids returned, but for the failed ones  we get only an error message. This forces us to look at the data either from the input or from the screen for the failures. We cannot decide an order of update on the client side since we do not know what order the SF server is responding. Is there any way to get around this problem or in short can I get the Ids of the errored updates. Any help in this regard would be extremely helpful to me. Thanks all. 

  • May 01, 2009
  • Like
  • 0

Hello,

        I would like to know if a WS client using API can update a lookup field in a custom object. So far I've searched the forum for a solution since I've been fighting with it for a while. I try to lookup Contacts from a Account object and assign it to a custom object that has a lookup field Contact__c if its already null,

 

This is the sequence I am doing,

 

1. I check if Contact__c is null in the object custom__c

2.  if null, I query the parent object Account for the Contacts

3. I get the Contacts in the Account and try to set the custom__c's lookup field as

     -  custom__cObj.setId(id)

     -  custom__cObj.Contact__r((Contact) qr.getRecords[i])

     -  binding.update(new SObject[] {custom__cObj})

 

where qr.getRecords[i] is a Contact.

Most people in the board talk about a trigger populating a lookup field, I am just wondering what I am doing wrong here. My code does not error out, this makes the situation worser. I am just not able to update the lookup Contact field. Could anyone please help me out on this. Thanks a lot.

   

 

  • April 16, 2009
  • Like
  • 0

Hello All,

             I am writing a java client to lookup contacts from a custom object Acct__c. Acct__c has a lookup field Contact__c and another field Customer__c (Master detail with Account object. We renamed Account to Customer). I get Acct__c.ID as input to my client. I retrieve Contact__c and see if a Contact is associated with the that Acct__c, if not I get the Customer__c from Acct__c and try to look up the parent object i.e Customer (Account). Here is the code I have,,

 

 

SObject[] acct__cObjects = sfBinding.retrieve("Acct_Contact__c,Customer__c","Acct__c",sfId);

//Verify if the Account has any contact associated
for(int i=0;i<acct__cObjects.length;i++)
{
Acct__c acctObject = (Acct__c) acct__cObjects[i];
if(acctObject.getAcct_Contact__c() == null)
{
//Account has not contact get contacts from customer
String acctCustomer = acctObject.getCustomer__c();

//Query Customer
String contactQuery = "Select (Select Id, LastName, FirstName, MailingStreet,MailingPostalCode, Phone,FaxMailingState From Contacts) From Account a where a.id = '" + acctCustomer + "'";

QueryResult contactQr = sfBinding.query(contactQuery);
System.out.println(contactQr.getSize());

if(contactQr.getSize() > 0)
{
boolean done = false;
SObject[] results = contactQr.getRecords();

for(int r=0;r<results.length;r++)
{
Account customerContacts = (Account) results[r];
}
}

 The point where I get stuck at is where I have to get the contacts thats the result of the query. When I try to do it like this

 

customerContacts.getContacts()  //here getContacts is a QueryResult. 

 

 

I believe I have to do a querymore() call there, but I am unsure how to do it though.Also, the statement (highlighted in red in the code) always gives a result of 1 irrespective of the fact that there is a contact in the Customer (Account) or not.

 

I'd appreciate if anyone helps me in this regard by directing me the right way. Thanks much.

 

 

Message Edited by SFNew on 04-15-2009 11:16 AM
  • April 15, 2009
  • Like
  • 0

Hello All,

             I am writing a java client to update our orgs tables in force.com. Now I can login using the http://

rather than the https:// URL. Now do I need to use the SF server certificate while making the login() call? I am concerned about the vulnerability of the user/password being hacked. If I need to use the certificate then what is the secure token used for??... I'd appreciate if anyone shed some light on this. Thanks.

  • April 13, 2009
  • Like
  • 0

Hello All,

             I am trying to write a client that would update our orgs data to force.com. I have a dilemma here. We are using the standard objects "Account" and "Contact". I understand CONTACT is an independent object that could be assigned to any ACCOUNT, also an ACCOUNT could have multiple contacts right?. We have a custom object CC__c that is a child of ACCOUNT. Now we have a custom look up field in CC__c that points to a particular CONTACT associated with that CC__c. So from SF page for CC__c, we can look up a CONTACT associated with the ACCOUNT. If I am confusing too much, the relationship is like this

 

ACCOUNT -->1..* CC_c 

 

ACCOUNT -->1..* CONTACT

 

CC__c -->(lookup field) 1..1 CONTACT

 

I was playing with contacts and realized that, if there is a CONTACT for ACCOUNT ABC Corp and its being associated with the object CC__c, I can assign the same CONTACT for another ACCOUNT BBC Corp and associate with CC__c object of BBC Corp. I tried to place a validation rule in the lookup custom field in the CC__c page. I am not sure if this is what I should be doing,if so could anyone help me with a validation snippet for the same, or is there any other way to handle this. Any help in this regard is greatly appreciated. Thanks much.

Message Edited by SFNew on 04-02-2009 08:50 AM
  • April 02, 2009
  • Like
  • 0

Hello All,

             I'd like to know if there are any "Governing Limits" when we use the enterprise WSDL to access our org's data. Please clarify. Thanks all.

  • March 17, 2009
  • Like
  • 0

Hello All,

             I have a task that requires me to update our org's SF pages using data internal to our org. I have very little Apex development experience, but I've developed some small apex snippets as part of support. I am confused as to what would be the best bet in my case. I have to query a huge set of data from some tables and update certain objects in SF like Customer,Accounts,Contacts,Opportunity etc. Apex Reference document says that we should use Apex to,

 

"Process more than one record at a time efficiently, and with transactional correctness"

 

Apart from the "transactional correctness"I do not clearly understand the above statement. I am comfortable coding the entire piece in Java but I'd like to know the most efficient way of doing it to make the right architectural decision. Also, is there any governing limit that I should be concerned about? by going with Java or Apex? Please advice. Thanks all.

  • March 14, 2009
  • Like
  • 0

Hello,

          I am writing a client that updates our orgs data to SF. I am using API. I'd like to know if there is any way to know the object type from SF Id? I get the ID from our DB. I do not want to retrieve an SObject and then know that it is not what I wanted. Any help in this regard is greatly appreciated. Thanks all. 

  • May 13, 2009
  • Like
  • 0

Hello All,

              I am implementing a client using API, to sync our orgs  data with SF. I got the WSDL from prod since they have the updated objects and created those objects in my sandbox. Now I generated the client stubs from the prod WSDL and trying to do some update etc. I am getting the following exception,, I understand theoretically it should be po

// My login stub

SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap(new java.net.URL("http://www.test.salesforce.com/Services/Soap/c/15.0"));
salesforceLoginResult = binding.login(user,passwd); // Erroring out here when I did a trace
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,salesforceLoginResult.getServerUrl());



SessionHeader sessionHeader = new SessionHeader();
sessionHeader.setSessionId(salesforceLoginResult.getSessionId());
sfBinding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader",sessionHeader);

 

Error Message:

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.UnknownHostException: www.test.salesforce.com
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.UnknownHostException: www.test.salesforce.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
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:3047)
at Updater.main(Updater.java:61)

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

java.net.UnknownHostException: www.test.salesforce.com
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:3047)
at Updater.main(Updater.java:61)
Caused by: java.net.UnknownHostException: www.test.salesforce.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
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)

 

ssible to do what I am doing. I'd greatly appreciate if someone could point out if I am doing anything wrong here. 

 

Message Edited by SFNew on 05-03-2009 01:47 PM
  • May 03, 2009
  • Like
  • 0

Hello All,

              I am implementing a client using the API. I am getting the response back from SF as mentioned in the document. i.e. Successful updates have the SF Ids returned, but for the failed ones  we get only an error message. This forces us to look at the data either from the input or from the screen for the failures. We cannot decide an order of update on the client side since we do not know what order the SF server is responding. Is there any way to get around this problem or in short can I get the Ids of the errored updates. Any help in this regard would be extremely helpful to me. Thanks all. 

  • May 01, 2009
  • Like
  • 0

Hello All,

             I am writing a java client to lookup contacts from a custom object Acct__c. Acct__c has a lookup field Contact__c and another field Customer__c (Master detail with Account object. We renamed Account to Customer). I get Acct__c.ID as input to my client. I retrieve Contact__c and see if a Contact is associated with the that Acct__c, if not I get the Customer__c from Acct__c and try to look up the parent object i.e Customer (Account). Here is the code I have,,

 

 

SObject[] acct__cObjects = sfBinding.retrieve("Acct_Contact__c,Customer__c","Acct__c",sfId);

//Verify if the Account has any contact associated
for(int i=0;i<acct__cObjects.length;i++)
{
Acct__c acctObject = (Acct__c) acct__cObjects[i];
if(acctObject.getAcct_Contact__c() == null)
{
//Account has not contact get contacts from customer
String acctCustomer = acctObject.getCustomer__c();

//Query Customer
String contactQuery = "Select (Select Id, LastName, FirstName, MailingStreet,MailingPostalCode, Phone,FaxMailingState From Contacts) From Account a where a.id = '" + acctCustomer + "'";

QueryResult contactQr = sfBinding.query(contactQuery);
System.out.println(contactQr.getSize());

if(contactQr.getSize() > 0)
{
boolean done = false;
SObject[] results = contactQr.getRecords();

for(int r=0;r<results.length;r++)
{
Account customerContacts = (Account) results[r];
}
}

 The point where I get stuck at is where I have to get the contacts thats the result of the query. When I try to do it like this

 

customerContacts.getContacts()  //here getContacts is a QueryResult. 

 

 

I believe I have to do a querymore() call there, but I am unsure how to do it though.Also, the statement (highlighted in red in the code) always gives a result of 1 irrespective of the fact that there is a contact in the Customer (Account) or not.

 

I'd appreciate if anyone helps me in this regard by directing me the right way. Thanks much.

 

 

Message Edited by SFNew on 04-15-2009 11:16 AM
  • April 15, 2009
  • Like
  • 0