• vander
  • NEWBIE
  • 5 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 17
    Replies
hello -

i'm working on an sControl using beta 3 of the ajax toolkit. when i execute the following query:

var qr = sforceClient.Query("Select Id, ProductId, TotalPrice from OpportunityLineItem where OpportunityId = '" + oppId + "'");

it fails in firefox. however, when i try the exact same query in internet explorer it works fine. the query also works fine using firefox or internet explorer with beta 1 and beta 2 of the ajax toolkit.

any idea as to why this fails for beta 3 on firefox?
  • December 26, 2005
  • Like
  • 0
hello -

i've developed an sControl to automatically populate information on a custom object (calle CAR) from information on the the CASE object. everything is working well, except one of the fields i'm trying to populate is a lookup to another custom object (called CAR owners).

i am passing the proper ID to the lookup but it still won't take. my question is - is it even possible to update lookups from an sControl? if so, any tricks to doing so?

thanks!
  • November 07, 2005
  • Like
  • 0
hello -

i'm trying to create a case w/ the ajax toolkit and having some issues. Here is the javascript function:

//create case from asset using contact id and record type info
function createCase() {
//check that all required variables are set
if (assetId != "" && conId != "" && proTypeId != "" && proType != "") {
//create case dynabean
var _case = new DynaBean("Case");
_case.set("AssetId", assetId);
_case.set("ContactId", conId);
_case.set("RecordTypeId", proTypeId);
_case.set("Type", proType);
//create 1 new case
var saveResult = sforceClient.Create(_case);

alert("Here is the save result:"+saveResult.toString());

}
else {
alert("Error: Information required to create a Case directly from this Asset is missing.");
//return to asset page
frameNav(assetUrl);
}
}

saveResult.toString() is being returned as a null so i'm not getting any feedback. the variables being set are correct. any ideas/suggestions are much appreciated! thanks!
  • August 17, 2005
  • Like
  • 0
Hi -

I'm working on an S-Control using the AJAX toolkit to update the AssetId on a Case. My query is returning the correct Case Id and I have the correct AssetId to update with but my update is not working. My javascript function is below. This is my first time working with the AJAX toolkit and Case object so my syntax is probably incorrect. Any suggestions are appreciated:

function IsChecked(form, element_name, value)
{
//query sforce for current Case and current AssetId
var queryResult2 = sforceClient.Query("Select Id, CaseNumber, AssetId from Case Where CaseNumber = '" + caseId + "'");
//new array to hold results of updates
var updateObjects = new Array();
for (i = 0; i < form.elements.length; i++) {
if ((form.elements[i].name == element_name) && (form.elements[i].checked)) {
var aid = form.elements[i].value;
var _case = queryResult2.records[0];
//set case AssetId to checked value
_case.set("AssetId", aid);
//push updated AssetId to update array
updateObjects.push(_case);
}
}

if (updateObjects.length > 0) {
var x = window.confirm("Are you sure you want to update "+ updateObjects.length +" record(s) ?");
if (x) {
var sr = sforceClient.Update(updateObjects);
//window.parent.parent.location.href = retUrl;
window.close();
}
} else {
alert("No Records will be updated");
//window.parent.parent.location.href = retUrl;
window.close();
}
}
  • August 10, 2005
  • Like
  • 0
I wanted to see if someone on these boards could give me an answer to my question (s)!
 
We are currently migrating over to SFDC. Yesterday I downloaded the AppExchange Data loader and ran some tests on this application.  We have some internal systems which will need to retrieve data from SFDC once we are live.
 
I know that the data loader can be installed via Linux but what I need to know is the following:
 
1)  Once this is installed on Linux:
      a) can it be run as batch to dump the data to a specific location on a server?
      b) has anyone been successful dumping data to their own database (oracle, MySql, etc.)?
 
2)  If this is possible, can someone point me in the right direction or post some examples of what they have done in the past to make this work? 
     These internal systems/teams must be able to access the data (some required tables/fields).
 
Thanks in advance,
Mike
 

Message Edited by msimonds on 11-07-2006 07:44 AM

Message Edited by msimonds on 11-07-2006 07:51 AM

Maybe I'm missing something obvious here, but it sure is frustrating.  I'm using OSX 10.4.7 and Eclipse 3.1.  I have java 1.4.2 and 1.5 loaded (which might be a problem, but I wouldn't think so).  I can successfully create an AppExchange project and successfully download all current scontrols.  I can update them and save changes and they work.

#1
Problem comes in when I try to create a NEW scontrol using Eclipse.  I create a new file and immediately get "An unexpected error was thrown while trying to open the S-Control." along with a java.lang.NullPointerException.  This is a new scontrol, doesn't exist in salesforce yet.  Is there another way I'm supposed to create them?

#2
Then it actually does create the file locally to the workspace.  Great, I'll build it anyway.  I added a simple html tag and one word, test, updated the properties with the scontrol name and try to save.  "Field integrity exception occurred, check your merge field definitions." and another NullPointerException.  I didn't use any merge fields!

#3
Fine.  I'll just create what I need in a text editor and create the scontrol the old fashioned way by pasting it into the salesforce UI.  Then I can refresh the AppExchange project and at least maintain it with Eclipse, right?  Well the context menu "Refresh" does absolutely nothing.  I have to create a new project and start all over, and then I have the new scontrol available in Eclipse.

So what's going on?  BTW I've tried 3.2 with the latest beta version of the plugin, but that just flat doesn't even allow a connection to the soap endpoint.

I want to use this.  It's very cool.  Help!

Mark
I need to open an SControl in a new window from an SControl.  I am using the following code to do this:

window.open("/servlet/servlet.Integration?lid=00bT0000000nyaf&eid=" + OPPORTUNITY_ID, "winLookup", "height=600,width=350,location=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=1");

where "lid" is the id of the SControl I want to open in the new window.  Is there a more practical way to do this?


My other question is, how can I pass information to the SControl in the new window?  I tried inserting additional querystring parameters other than "lid" and "eid", but the additional parameters get stripped out from the querystring.  Any suggestions on how to pass the information to the SControl in the new window?

Thanks in advance.

Message Edited by dotneteric on 06-01-2006 08:34 PM

I have been encountering a
java.net.ConnectException: Connection refused: connect
exception each time I try to run my code.   It was running fine last week and I have been having issues since Tuesday.  (I installed an anti-virus over the weekend, which I have now uninstalled.  Also installed a Windows Update)
 
The Exception is being thrown when I try to login
 
lr = binding.login("user", "pwd");
 
My machine doesn't use any proxy and doesn't have any specific firewall installed (many message board posts refer to a firewall as being the main cause for this error).  I am running Windows XP SP2.  The Windows Firewall in Control Panel has been disabled.
 
I am baffled and looking for hints on what I should try next.  Please help
 
Thanks,
 
 java.net.ConnectException: Connection refused: connect
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.net.ConnectException: Connection refused: connect
 faultActor:
 faultNode:
 faultDetail:
 {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: 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 java.net.Socket.connect(Socket.java:457)
 at java.net.Socket.&lt;init&gt;(Socket.java:365)
 at java.net.Socket.&lt;init&gt;(Socket.java:178)
 at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:103)
 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:1932)
 at we.WebServiceConnector.login(WebServiceConnector.java:106)
 at we.WebServiceConnector.main(WebServiceConnector.java:48)
  • May 04, 2006
  • Like
  • 0
Hi
I guess that this is a quite common and simple problem but I cant find any easy way out.
 
I'm trying to update an account with values from a description field on another object. Everything works just fin as loong as I dont use data that contains funny characters as "&", carriage returns and so on.  Tryign to update data with these values makes the script crash...
I'd be really greatfull if anyone have a solution to this!
 
Cheers!
 
/Olof
 
Script sample:
function UppdateAccount() {
var queryResult = sforceClient.Query("Select ID, Name, Description from Account where ID='" + s_AccID + "'");
if (queryResult.getClassName() == "SoapFault") {
alert(
"Error Updating Account: " + queryResult.toString());
}
else {
if (queryResult.size > 0)
{
if (queryResult.size > 0) {
var account = queryResult.records[0];
account.set("Description", s_ACText);
queryResult.records[0] = account;
var sr = sforceClient.Update(queryResult.records);
try {
if (sr.getClassName() == "SoapFault") {
alert(
"Error updating Account: " + sr.toString());
}
}
catch (e) {
if (sr[0].getClassName() == "SaveResult"){
return(true);
}
}
}
}
else
{
alert(
"Couldn't find account, not updated.");
}
}
}
I'm creating a query to do a bulk update on a set of records. The QueryResult size property is 561, but the records array is only of length 200. Is this a known bug, and is there any workaround for it?

-Eric Hawthorne
  • April 19, 2006
  • Like
  • 0

I want to know what is the best way to call a web service from Salesforce.

The process involves
From an Contact SF page...
1.Call a webservice that I host in my webserver
2.Creating a task associated with the contact based on the webservice result


Also
What the best way to authenticate in my web service
1 - Should I create a UsernameWs/PasswordWs Field in the User Object and pass it
or
2 - pass the sessionId

Any thoughts on how to create a PDF page from an scontrol.  The best option I've seen so far is manual - create HTML, save (IE only), and use an online service that generates the PDF.  Checking to see if there is another way...
Thanks.
  • April 17, 2006
  • Like
  • 0
Is there any way to integrate an scontrol to run a report and click the printable view button, without the user seeing the report being run.  I want to have a custom link that users click that runs a report.  I don't want users to be able to see the report as this will encourage them to alter the report (which I don't want).
 
Basically an scontrol that runs a report (the user doesn't see this report) and then runs the printable view button to display the results in excel (the user would basically click the custom link, from the home page, then the excel file would be displayed).
 
The information I want to dipaly is a customopportunity field and  a few standard opportunity fields.
 
Is this possible?  How do I go about this?  Has anyone got any sample code?
 
 
hello -

i'm working on an sControl using beta 3 of the ajax toolkit. when i execute the following query:

var qr = sforceClient.Query("Select Id, ProductId, TotalPrice from OpportunityLineItem where OpportunityId = '" + oppId + "'");

it fails in firefox. however, when i try the exact same query in internet explorer it works fine. the query also works fine using firefox or internet explorer with beta 1 and beta 2 of the ajax toolkit.

any idea as to why this fails for beta 3 on firefox?
  • December 26, 2005
  • Like
  • 0
hello -

i've developed an sControl to automatically populate information on a custom object (calle CAR) from information on the the CASE object. everything is working well, except one of the fields i'm trying to populate is a lookup to another custom object (called CAR owners).

i am passing the proper ID to the lookup but it still won't take. my question is - is it even possible to update lookups from an sControl? if so, any tricks to doing so?

thanks!
  • November 07, 2005
  • Like
  • 0
hello -

i'm trying to create a case w/ the ajax toolkit and having some issues. Here is the javascript function:

//create case from asset using contact id and record type info
function createCase() {
//check that all required variables are set
if (assetId != "" && conId != "" && proTypeId != "" && proType != "") {
//create case dynabean
var _case = new DynaBean("Case");
_case.set("AssetId", assetId);
_case.set("ContactId", conId);
_case.set("RecordTypeId", proTypeId);
_case.set("Type", proType);
//create 1 new case
var saveResult = sforceClient.Create(_case);

alert("Here is the save result:"+saveResult.toString());

}
else {
alert("Error: Information required to create a Case directly from this Asset is missing.");
//return to asset page
frameNav(assetUrl);
}
}

saveResult.toString() is being returned as a null so i'm not getting any feedback. the variables being set are correct. any ideas/suggestions are much appreciated! thanks!
  • August 17, 2005
  • Like
  • 0
Hi -

I'm working on an S-Control using the AJAX toolkit to update the AssetId on a Case. My query is returning the correct Case Id and I have the correct AssetId to update with but my update is not working. My javascript function is below. This is my first time working with the AJAX toolkit and Case object so my syntax is probably incorrect. Any suggestions are appreciated:

function IsChecked(form, element_name, value)
{
//query sforce for current Case and current AssetId
var queryResult2 = sforceClient.Query("Select Id, CaseNumber, AssetId from Case Where CaseNumber = '" + caseId + "'");
//new array to hold results of updates
var updateObjects = new Array();
for (i = 0; i < form.elements.length; i++) {
if ((form.elements[i].name == element_name) && (form.elements[i].checked)) {
var aid = form.elements[i].value;
var _case = queryResult2.records[0];
//set case AssetId to checked value
_case.set("AssetId", aid);
//push updated AssetId to update array
updateObjects.push(_case);
}
}

if (updateObjects.length > 0) {
var x = window.confirm("Are you sure you want to update "+ updateObjects.length +" record(s) ?");
if (x) {
var sr = sforceClient.Update(updateObjects);
//window.parent.parent.location.href = retUrl;
window.close();
}
} else {
alert("No Records will be updated");
//window.parent.parent.location.href = retUrl;
window.close();
}
}
  • August 10, 2005
  • Like
  • 0

After creating a web-integration (Sforce Control) link, all seems to be working properly, however when navigating to the page, the user is prompted asking them whether or not they would like to accept NON-Secure Items.

I realize, this can be stopped on a per-user basis, by changing the IE Options to Accpet Non-Secure Items and not prompt, however is there any other way to avoid this message other than changin the Explorer Options?

Thank You.

  • April 22, 2004
  • Like
  • 0