• Mimiran
  • NEWBIE
  • 25 Points
  • Member since 2006

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

Hi, after our security review I was given an API token to enable Professional edition API support.  Let's say that token is "My.Secret.Token".  I put in code to use that token but it doesn't work. :(  Salesforce support says the token is active so it must be my code.

 

First, is it possible to mix the Partner API and Enterprise API?  I've been using the Enterprise API throughout our code as it's much simpler, but this one part requires the Partner API.  It compiles & runs fine but I wonder if this is why it's not working.  Do I now have to convert the rest of my code to the Partner API?

 

Second, is the below code correct?

 

// Everything uses Enterprise API except CallOptions (which only exists in Partner API)

import com.sforce.soap.enterprise.SoapBindingStub;
import com.sforce.soap.partner.CallOptions;

 

final String TOKEN_FOR_PROFESSIONAL_EDITION = "My.Secret.Token";

SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
CallOptions co = new CallOptions();
co.setClient(TOKEN_FOR_PROFESSIONAL_EDITION);
binding.setHeader("SforceService", "CallOptions", co);

LoginResult lr = binding.login(user, pass); // Professional Ed's throw exception!

 

 Thanks for your help!

 

There are some minor bugs in the "Hello World" example in the "AJAX Getting Started - Part 1 Guide", linked from the AJAX Beta3 page:  http://blog.sforce.com/sforce/2006/04/ajax_toolkit_be.html .  The bugs are minor and don't affect the normal output, but since it's a Hello World app it'll be used as a reference. (I actually found the bug when trying to use this as a reference.)

Here is the meat of the Hello World example at the bottom of Part 1 of the guide.  My changes are in red.  The first part creates a textNode variable but doesn't use it (that line is useless and should be deleted), while the second part creates a variable and wants to use it but doesn't (the text node needs to be added to the document).


                   if (queryResult.size > 0) {
                       
var
output = "";
                       
for
(var i=0;i<queryResult.records.length;i++) {
                           
var
dynaBean = queryResult.records[i];
                           
output += dynaBean.get(
"Id") + " " + dynaBean.get("name") + " [Industry - " + dynaBean.get("Industry") + "]<br>";
                       
}

                        // this line is useless, so take it out
                        //
var
textNode = document.createTextNode(output);
                       
document.getElementById(
"output").innerHTML = output;
                   
} else {

                       
var
textNode = document.createTextNode("No records matched.");
                         // this textNode needs to be added to the document to get displayed:
                        document.getElementById("output").appendChild(textNode);
                    }

Hi, after our security review I was given an API token to enable Professional edition API support.  Let's say that token is "My.Secret.Token".  I put in code to use that token but it doesn't work. :(  Salesforce support says the token is active so it must be my code.

 

First, is it possible to mix the Partner API and Enterprise API?  I've been using the Enterprise API throughout our code as it's much simpler, but this one part requires the Partner API.  It compiles & runs fine but I wonder if this is why it's not working.  Do I now have to convert the rest of my code to the Partner API?

 

Second, is the below code correct?

 

// Everything uses Enterprise API except CallOptions (which only exists in Partner API)

import com.sforce.soap.enterprise.SoapBindingStub;
import com.sforce.soap.partner.CallOptions;

 

final String TOKEN_FOR_PROFESSIONAL_EDITION = "My.Secret.Token";

SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
CallOptions co = new CallOptions();
co.setClient(TOKEN_FOR_PROFESSIONAL_EDITION);
binding.setHeader("SforceService", "CallOptions", co);

LoginResult lr = binding.login(user, pass); // Professional Ed's throw exception!

 

 Thanks for your help!

 

There are some minor bugs in the "Hello World" example in the "AJAX Getting Started - Part 1 Guide", linked from the AJAX Beta3 page:  http://blog.sforce.com/sforce/2006/04/ajax_toolkit_be.html .  The bugs are minor and don't affect the normal output, but since it's a Hello World app it'll be used as a reference. (I actually found the bug when trying to use this as a reference.)

Here is the meat of the Hello World example at the bottom of Part 1 of the guide.  My changes are in red.  The first part creates a textNode variable but doesn't use it (that line is useless and should be deleted), while the second part creates a variable and wants to use it but doesn't (the text node needs to be added to the document).


                   if (queryResult.size > 0) {
                       
var
output = "";
                       
for
(var i=0;i<queryResult.records.length;i++) {
                           
var
dynaBean = queryResult.records[i];
                           
output += dynaBean.get(
"Id") + " " + dynaBean.get("name") + " [Industry - " + dynaBean.get("Industry") + "]<br>";
                       
}

                        // this line is useless, so take it out
                        //
var
textNode = document.createTextNode(output);
                       
document.getElementById(
"output").innerHTML = output;
                   
} else {

                       
var
textNode = document.createTextNode("No records matched.");
                         // this textNode needs to be added to the document to get displayed:
                        document.getElementById("output").appendChild(textNode);
                    }