• M.
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 8
    Replies
hello everyone... I already can make queries to salesforce... but now I can't iterate on the array... I'm still very noob to php....

this is the query I'm using...

  $result = $sforce->query(array("queryString" => "Select SolutionNote from Solution where Solution.Status='Revisto'"));
    print_r($result);

the "print_r" prints the whole array...

how can I iterate through all the $result values...


can something like the following be done?

for(i=0; i<10; i++)
{
     print_r($result[i]);
}


Thank you.

M.
  • June 21, 2007
  • Like
  • 0
hello everyone... I already can make queries to salesforce... but now I can't iterate on the array... I'm still very noob to php....

this is the query I'm using...

  $result = $sforce->query(array("queryString" => "Select SolutionNote from Solution where Solution.Status='Revisto'"));
    print_r($result);

the "print_r" prints the whole array...

how can I iterate through all the $result values...


can something like the following be done?

for(i=0; i<10; i++)
{
     print_r($result[i]);
}


Thank you.

M.

  • June 21, 2007
  • Like
  • 0
Hello again everyone....

I'm still having problems with php and its queries to salesforce... It always shows me a blank screen...

does anybody have a working code sample that does a short query to salesforce so that I can discover what's going wrong with my code?

Any help would be very useful.

Thank you

M
  • June 19, 2007
  • Like
  • 0
Hello again everyone....

I'm still having problems with php and its queries to salesforce... It always shows me a blank screen...

does anybody have a working code sample that does a short query to salesforce so that I can discover what's going wrong with my code?

Any help would be very useful.

Thank you

M
  • June 19, 2007
  • Like
  • 0
Hello, can anyone help me with this?

This code is not working very well...

until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...

can anyone help me with this please?

<?php
 
require_once ('C:\Program Files\PHP\ext\soapclient\SforcePartnerClient.php');

try
{
    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("admin@*****.com", "******");
 
      print "Reaching this print";  
 
      $userResult = $mylogin->userInfo;
      print $userResult->userFullName.', your session id is '.$mylogin->sessionId;

}
catch (Exception $e)
{
  echo $e->faultstring;
}

try
{
   // $result = $sforce->query(array("queryString" => "select Id, FirstName, LastName from Lead where Lead.FirstName='Miguel'"));
   // print_r($result);
   $query =  "select Id from Lead where Lead.FirstName='Miguel'";
   $result = $sforce->query($query);
   print_r($result);
   print "NOT REACHING THIS PRINT!";

} catch (Exception $e)
{
    print_r($e);
}
?>
  • June 13, 2007
  • Like
  • 0
Hello, can anyone help me with this?

This code is not working very well...

until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...

can anyone help me with this please?

<?php
 
require_once ('C:\Program Files\PHP\ext\soapclient\SforcePartnerClient.php');

try
{
    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("admin@*****.com", "******");
 
      print "Reaching this print";  
 
      $userResult = $mylogin->userInfo;
      print $userResult->userFullName.', your session id is '.$mylogin->sessionId;

}
catch (Exception $e)
{
  echo $e->faultstring;
}

try
{
   // $result = $sforce->query(array("queryString" => "select Id, FirstName, LastName from Lead where Lead.FirstName='Miguel'"));
   // print_r($result);
   $query =  "select Id from Lead where Lead.FirstName='Miguel'";
   $result = $sforce->query($query);
   print_r($result);
   print "NOT REACHING THIS PRINT!";

} catch (Exception $e)
{
    print_r($e);
}
?>
  • June 13, 2007
  • Like
  • 0
Hello everyone....

I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?

I'm ussing a login code, and then this...

try
{
    $result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
    print_r($result);
    print "I'm not reaching this print";
} catch (Exception $e)
{
    print_r($e);
}


what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you

M.
  • June 12, 2007
  • Like
  • 0
Hello everyone....

I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?

I'm ussing a login code, and then this...

try
{
    $result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
    print_r($result);
    print "I'm not reaching this print";
} catch (Exception $e)
{
    print_r($e);
}


what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you

M.

  • June 12, 2007
  • Like
  • 0
Hello everyone...

I'm having an error while trying to access salesforce through php...

"SSL support is not available in this build"

Hou can this be solved?

thank you!

M.
  • June 11, 2007
  • Like
  • 0
Hello everyone...

I'm having an error while trying to access salesforce through php...

"SSL support is not available in this build"

Hou can this be solved?

thank you!

M.
  • June 11, 2007
  • Like
  • 0
hello everyone... does anyone know how to get the sforce.wsdl file?

I think I'm going to need it so tha I can connect to salesforce using php...

thank you

M.
  • June 08, 2007
  • Like
  • 0
hello everyone... does anyone know how to get the sforce.wsdl file?

I think I'm going to need it so tha I can connect to salesforce using php...

thank you

M.
  • June 08, 2007
  • Like
  • 0
    Hello everyone,

I'm having problems while attempting to connect to salesforce using SOAP... it seems that a file is needed...

SforcePartnerClient.php file... does anyone know how I can get this file?

Thank you...

M.
  • June 05, 2007
  • Like
  • 0
    Hello everyone,

I'm having problems while attempting to connect to salesforce using SOAP... it seems that a file is needed...

SforcePartnerClient.php file... does anyone know how I can get this file?

Thank you...

M.
  • June 05, 2007
  • Like
  • 0
   Hello everyone...

I need to test some php code, but I don't have SOAP installed on my PC.. does anyone know how to get it? thank you

M.
  • June 05, 2007
  • Like
  • 0
    Hello everyone...

I need to test some php code, but I don't have SOAP installed on my PC.. does anyone know how to get it? thank you

M.
  • June 05, 2007
  • Like
  • 0
Hello once again... I've been trying to get some information from salesforce fields...

I've created a javascript that allows me to access the solutions table and access its fields...

this works well in a s-control... now, what I want is to access it from a external website... I know that, in order to do that, i'll need the login and password, but i don't know how to make that connection... can anyone help me? here goes the code sample...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>

<script>

<!--

function initPage()
{
sforceClient.registerInitCallback(setup);

sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", true);
}

//Use this function as the entry point for your DHTML and JAVASCRIPT processing

function setup()
{
var queryResult = sforceClient.query("Select Id, Status, SolutionNote From Solution", layoutResults);

}

function layoutResults(queryResult)
{

if (queryResult.className == "Fault")
{
alert("There was an error: " + queryResult.toString());

}

else
{
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("Status") +" "+ dynaBean.get("SolutionNote") +"<br>";

}

var textNode = document.createTextNode(output);

document.getElementById("output").innerHTML = output;

}

else
{
var textNode = document.createTextNode("No records matched.");

}
}
}

//-->

</script>
<script>
alert("Testing")
</script>

</head>

<body onload="initPage()">

<div id="output"></div>

</body>

</html>
  • June 01, 2007
  • Like
  • 0
Hello once again... I've been trying to get some information from salesforce fields...

I've created a javascript that allows me to access the solutions table and access its fields...

this works well in a s-control... now, what I want is to access it from a external website... I know that, in order to do that, i'll need the login and password, but i don't know how to make that connection... can anyone help me? here goes the code sample...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>

<script>

<!--

function initPage()
{
sforceClient.registerInitCallback(setup);

sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", true);
}

//Use this function as the entry point for your DHTML and JAVASCRIPT processing

function setup()
{
var queryResult = sforceClient.query("Select Id, Status, SolutionNote From Solution", layoutResults);

}

function layoutResults(queryResult)
{

if (queryResult.className == "Fault")
{
alert("There was an error: " + queryResult.toString());

}

else
{
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("Status") +" "+ dynaBean.get("SolutionNote") +"<br>";

}

var textNode = document.createTextNode(output);

document.getElementById("output").innerHTML = output;

}

else
{
var textNode = document.createTextNode("No records matched.");

}
}
}

//-->

</script>
<script>
alert("Testing")
</script>

</head>

<body onload="initPage()">

<div id="output"></div>

</body>

</html>
  • June 01, 2007
  • Like
  • 0
Hello once again... I've been trying to get some information from salesforce fields...

I've created a javascript that allows me to access the solutions table and access its fields...

this works well in a s-control... now, what I want is to access it from a external website... I know that, in order to do that, i'll need the login and password, but i don't know how to make that connection... can anyone help me? here goes the code sample...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>

<script>

<!--

function initPage()
{
sforceClient.registerInitCallback(setup);

sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", true);
}

//Use this function as the entry point for your DHTML and JAVASCRIPT processing

function setup()
{
var queryResult = sforceClient.query("Select Id, Status, SolutionNote From Solution", layoutResults);

}

function layoutResults(queryResult)
{

if (queryResult.className == "Fault")
{
alert("There was an error: " + queryResult.toString());

}

else
{
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("Status") +" "+ dynaBean.get("SolutionNote") +"<br>";

}

var textNode = document.createTextNode(output);

document.getElementById("output").innerHTML = output;

}

else
{
var textNode = document.createTextNode("No records matched.");

}
}
}

//-->

</script>
<script>
alert("Testing")
</script>

</head>

<body onload="initPage()">

<div id="output"></div>

</body>

</html>
  • June 01, 2007
  • Like
  • 0
    Hello, I'm new to salesforce and I've been trying to access the public knowledge base using html+javascript in order to publish some data from the knowledge base to a website that I'm developing.

I don't even know how to start... can anyone give me some pointers, in order to access the database from an outside website....

thank you very much..

M.
  • June 01, 2007
  • Like
  • 0
Hello, can anyone help me with this?

This code is not working very well...

until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...

can anyone help me with this please?

<?php
 
require_once ('C:\Program Files\PHP\ext\soapclient\SforcePartnerClient.php');

try
{
    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("admin@*****.com", "******");
 
      print "Reaching this print";  
 
      $userResult = $mylogin->userInfo;
      print $userResult->userFullName.', your session id is '.$mylogin->sessionId;

}
catch (Exception $e)
{
  echo $e->faultstring;
}

try
{
   // $result = $sforce->query(array("queryString" => "select Id, FirstName, LastName from Lead where Lead.FirstName='Miguel'"));
   // print_r($result);
   $query =  "select Id from Lead where Lead.FirstName='Miguel'";
   $result = $sforce->query($query);
   print_r($result);
   print "NOT REACHING THIS PRINT!";

} catch (Exception $e)
{
    print_r($e);
}
?>
  • June 13, 2007
  • Like
  • 0
Hello everyone....

I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?

I'm ussing a login code, and then this...

try
{
    $result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
    print_r($result);
    print "I'm not reaching this print";
} catch (Exception $e)
{
    print_r($e);
}


what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you

M.
  • June 12, 2007
  • Like
  • 0
Hello everyone...

I'm having an error while trying to access salesforce through php...

"SSL support is not available in this build"

Hou can this be solved?

thank you!

M.
  • June 11, 2007
  • Like
  • 0
hello everyone... does anyone know how to get the sforce.wsdl file?

I think I'm going to need it so tha I can connect to salesforce using php...

thank you

M.
  • June 08, 2007
  • Like
  • 0
hello everyone... does anyone know how to get the sforce.wsdl file?

I think I'm going to need it so tha I can connect to salesforce using php...

thank you

M.
  • June 08, 2007
  • Like
  • 0
   Hello everyone...

I need to test some php code, but I don't have SOAP installed on my PC.. does anyone know how to get it? thank you

M.
  • June 05, 2007
  • Like
  • 0