• ElenaCapta
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 10
    Replies
Code:
while (stopLooping == false) { 

for (var i=0;i<_qrCases.records.length;i++) { 
var row; 
docContents += "<tr class=\"letraGris\">"; 



case = _qrCases.records[i];
var contactname=case.get("ContactId");
var idcase = case.get("Id");

docContents += "<td align='left'><a href = '/"+idcase+"' target=_parent> "+ case.get("Type")+"</a></td>";

docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";

docContents += "<td align='left'><a href = '/"+idcase+"' target=_parent> "+ case.get("CaseNumber")+"</a></td>";

docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";

//The next it's slow

if(contactname !=''){
var contactquery = sforceClient.Query("Select FirstName, LastName from Contact where Id='"+contactname+"'");
docContents += "<td align='left'><a href = '/"+contactname+"' target=_parent>"+contactquery.records[0].get("FirstName")+" "+contactquery.records[0].get("LastName")+"</a></td>";
docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";}
else{
docContents += "<td align='left'></td>";
docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";}

//***************

docContents += "<td align='left'><a href = '/"+idcase+"' target=_parent> "+case.get("Status")+"</a></td>";

docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";

docContents += "<td align='left'><a href = '/"+idcase+"' target=_parent> "+case.get("LastModifiedById")+"</a></td>";

docContents += "<td bgcolor=\"#F3F3EC\" width=1 nowrap><img src=\"https://na1.salesforce.com/s.gif\"></td>";

docContents += "</tr>"; 
docContents += "<tr height='5'><td>&nbsp;</td></tr>";
_cases[case.get("Id")] = case; 
} //for

if (_qrCases.done == true) { 
stopLooping = true; 
} else { 
_qrCases = sforceClient.QueryMore(_qrCases.queryLocator); 
}
 
hello!
 
I have a problem because the previous code it's more slow, Somebody Knows how I can optimize the code?
 
Thanks!!
 
 
hello,
 
I download the application Convert with Record Type of the Appexchange, ant it doesn't work.
When I fill the form it print an error like this:
 
could not convert lead 00Q20000001vcK7sdfa
invalid convertedStatus: Closed - converted
 
Note: the status of the lead are Open - contacted
 
Somebody knows the reason?
 
thanks!!!
Hello!
 
I have a question, when I create a S-Control where I have an array with objects and I want to print this objects if the size of the array is long (for example 100 or more object) I have an error and it don't print the results, and when the size is 20 or 30 for example it print the results.
 
Anybody can help me??
 
Thanks!!!
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,protection,screem,tty,tv" rel="stylesheet">
<link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,protection,screem,tty,tv" rel="stylesheet">


<html>

<script type="text/javascript" src="/js/functions.js"></script>
<script language="javascript" src="http://www.sforce.com/ajax/beta1/sforceclient.js" type="text/javascript"></script>
<script language="JavaScript">

sforceClient.init("{!API_Session_ID}","{!API_Partner_Server_URL_70}");

function SearchAccount(){

SearchString ="Select Id, Site, Phone, Name From Account where Name like '%" +document.AccountSearchForm.AccountName.value +% ' ";

var queryResult = sforceClient.Query(SearchString);

// BUILD TABLE

var output = "<table width='100%' class=list border='0' cellspacing='0' cellpadding='0'><tr class=headerRow height=20>";
output += "<th nowrap'> Account Name </th>;
output += "<th nowrap'> Account Site </th>;
output += "<th nowrap'> Account Phone </th>;

//BUILD TABLE ROWS

for (var j=0; j<queryResult.records.length; j++){
var Account = queryResult.records[j];

output +="<tr onmouseover=hiOn(this) onmouseout = hiOff(this)>";
output +="<td> <a href='/"+Account.id "' target=_parent>"+ Account.name + "</a></td>";
output += "<td>" + Account.site + "</td>";
output += "<td>" + Account.phone + "</td></tr>";}

output+="</table>";
document.getElementById ("ResultsHolder").innerHTML = output;
}

</script>
<body class="account">
<b>Account Search Page</b>

<div class=bPageTitle>
<div class="ptBody secondaryPalette">
<div class=content> <img class=pageTitleIcon alt=Account src="/s.gif">
<h1 class=pageType>Cuenta<SPAN class=titleSeparatingColon>:</SPAN></h1>
<h2 class=pageDescription>Busqueda de Página</h2>
</div></div></div>

<div class="bPageBlock secondaryPalette">
<div class=pbBody>
<div class=pbSubsection>
</div></div></div>

<form name=AccountSearchForm method ="POST" action="javascript:SearchAccount()">
<table cellSpacing=0 cellPadding=0 border=0>
<tr align=left><td class=labelCol>Nombre Cuenta: <input name"AccountName" type="text" size=30"></td></tr>

<tr><td align=center> <input class=btn type="submit" name="submit" value= "Search"></td></tr>

</table>

<div id="ResultsHolder"></div>

</form>
</body>
</html>

 
hello, anybody can help me?? It's the first time that i work with Style Sheet and I test this code that it's an easy S-Control and the Style don't work. I add the code for if somebody know where is the problem.
 
Thanks and best regards!
 
 
 
 
hello!
 
In the AppexangeApi Documentation said that we can't use for SOQL the ORDER BY clause, anybody knows what can I do in a "select" so that the results are order by a particular field?
 
Thanks, Elena
Hi,
 
I need help with the next question. I want to send a mail for a lead that it hold a link to my web, it's possible and which is the method that when the lead do click on the link in my salesforce i  will can see that this lead has done click.
Other question is when a lead inside in my web and he refill a form when he send the form in my salesforce it's possible that not create a new lead, that only search if the lead exist (in this case add the data of the form) and only if not exist create and add the data.
 
Thanks, and best regards!
Elena 
Hi,
somebody can help me with Data Loader??
 
I have a CSV file with 4 columns, for example: Id, Name, LastName and Company. The Id isn't the Id of salesforce it's of other application. In the object Lead exist a field that it's a external Id (Idext__c).
 
When I create the map I  I drag de Id column with the Idext__c, and when I INSERT it's work very well but when I change any field of CSV and I test to UPDATE the CSV isn't work. The error message it's:
 
Id not specified
 
What can I do to update the changes if I haven't the Id of salesforce in the CSV?

Thanks!!! and Best Regards

Elena

Anybody can tell me which is the usefulness of the external Id option? this option it's when you create a new field for an object. What possibilities it offers?
 
Thanks, and best regards!!!
 
 
Hi
I'm doing a Scontrol similar to a convertlead function but with more dificult. When I convert the register I will need to marc this but I don't know where...
I know that when I convertlead with the function of API in some place exist a field where the value is stored. which this field is?, where is? and How can I modify it?
 
Thanks, best regards!

Hi,
 
I want to know the length of a list, I'm use the next code. Does anybody know where is the error?
 
Thanks and best regards
Code:
<script src="http://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script> 
<script> 

function initPage ( ) { 
sforceClient.registerInitCallback (setupPage); 
sforceClient.init ( "{!API_Session_ID}" , "{!API_Partner_Server_URL_70}" ); 
} 

function setupPage ( ) { 
cuenta ='{!Account_Name}'; 
var queryResult = sforceClient.query("Select Id from Opportunity where Account =' "+cuenta+" ' and StageName = 'Ganada' ", false); 
var e =[]; 
e = queryResult; 
alert ('Test: '+e.length); 
} 

 
Hi all,
 
now i try to create a SControl where the result are a fields of the result object and I whant that this results are a link to the object. Does somebody  know how can i do this? 
 
Thanks, and best regards!
 
Elena
Does someone know if Data Loader to Professional Edition exists?
 
Thanks and Best Regards
 
Elena

Hi,

anybody knows if it's posible to put on the home page of salesforce a text box with a link that refers to an sforce control, and take the text of the text box and use it in the sforce control?

Can you help me??

Thanks!:smileywink:

Hi, Anybody Know what is the proble in this code?? I'm new in SalesForce and don't get anything...
Please help me!!!
 
The code is:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Crear Una Cuenta</title>
</head>
<body >
<script language="javascript" src="https://www.sforce.com/ajax/beta1/sforceclient.js" type="text/javascript"></script>
<script language="javascript">
 
Account objMyaccount = new Account();
objMyaccount.setName("Koka Kola"); 
objMyaccount.setWebsite("www.kokakola.com");
 
sObject[] records = new sObject[] {objMyaccount };  
SaveResult[] saveResults = sfdc.create(records);
String newID = saveResults[0].id;
if (saveResults[0].getSuccess())
          {
           // No errors, so we will retrieve the id created for this index
           System.out.println("Attachment with id " + saveResults[0].getId());
          }
        else
          {
            System.out.println("Error during creation of attachment " + saveResults[0].getErrors());
          }
</body>
</html>
 
Thanks!!!!
Hi,
I want to create an account and to asing the values of one lead. Now I do a easy test but It does not work. Anybody can say me whats it's the problem in my code? The code is:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Convertir Candidatos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body>
 
<script language="javascript">
//NTR des SControl Duplicar Contrato v1 .html
//THE WEB LINK MUST BE OPENED IN THE SAME WINDOW
  
var sfdc = new ActiveXObject('SForceOfficeToolkit.SForceSession');
sfdc.SetServerUrl('{!API_Enterprise_Server_URL_50}');
sfdc.SessionId = '{!API_Session_ID}';
   
var leadId = '{!Lead_ID}';
var qrs = sfdc.Query("Select * from Lead where Id = '"+leadId+"'", false)
var e = new Enumerator(qrs);
var sobj = e.item();
  
    
var newCItems = new Array(1);
newCItems[0] = sfdc.CreateObject("Account");
var e2 = new Enumerator(newCItems);
var sobj2 = e2.item();
    
document.writeln("<strong>WAIT PLEASE............................</strong><BR>");
//Lead Information:
sobj2.item('Name').value = 'NameAccount';
sobj2.item('Phone').value = sobj.item('MobilePhone').value;
sobj2.item('CreatedById').value = sobj.item('CreatedById').value;
document.writeln("<strong>...................OK......................</strong><BR>");
if (sfdc.Error == 0) {
     sobj2 = newCItems[0];
     var idNuevoContrato = sobj2.item('Id').value;
     
}else{
     alert("ERROR : Salesforce.com cannot duplicate the contract");
    }
</script>
</body>
</html>
 
 
Thanks!!!

Message Edited by ElenaCapta on 06-07-2006 03:41 AM

I want to create a Custom S-Control only with convertLead but I'm new in Salesforce and I can't obtain the result. How can I do? and Anybody have an example?
 
Thanks!
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,protection,screem,tty,tv" rel="stylesheet">
<link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,protection,screem,tty,tv" rel="stylesheet">


<html>

<script type="text/javascript" src="/js/functions.js"></script>
<script language="javascript" src="http://www.sforce.com/ajax/beta1/sforceclient.js" type="text/javascript"></script>
<script language="JavaScript">

sforceClient.init("{!API_Session_ID}","{!API_Partner_Server_URL_70}");

function SearchAccount(){

SearchString ="Select Id, Site, Phone, Name From Account where Name like '%" +document.AccountSearchForm.AccountName.value +% ' ";

var queryResult = sforceClient.Query(SearchString);

// BUILD TABLE

var output = "<table width='100%' class=list border='0' cellspacing='0' cellpadding='0'><tr class=headerRow height=20>";
output += "<th nowrap'> Account Name </th>;
output += "<th nowrap'> Account Site </th>;
output += "<th nowrap'> Account Phone </th>;

//BUILD TABLE ROWS

for (var j=0; j<queryResult.records.length; j++){
var Account = queryResult.records[j];

output +="<tr onmouseover=hiOn(this) onmouseout = hiOff(this)>";
output +="<td> <a href='/"+Account.id "' target=_parent>"+ Account.name + "</a></td>";
output += "<td>" + Account.site + "</td>";
output += "<td>" + Account.phone + "</td></tr>";}

output+="</table>";
document.getElementById ("ResultsHolder").innerHTML = output;
}

</script>
<body class="account">
<b>Account Search Page</b>

<div class=bPageTitle>
<div class="ptBody secondaryPalette">
<div class=content> <img class=pageTitleIcon alt=Account src="/s.gif">
<h1 class=pageType>Cuenta<SPAN class=titleSeparatingColon>:</SPAN></h1>
<h2 class=pageDescription>Busqueda de Página</h2>
</div></div></div>

<div class="bPageBlock secondaryPalette">
<div class=pbBody>
<div class=pbSubsection>
</div></div></div>

<form name=AccountSearchForm method ="POST" action="javascript:SearchAccount()">
<table cellSpacing=0 cellPadding=0 border=0>
<tr align=left><td class=labelCol>Nombre Cuenta: <input name"AccountName" type="text" size=30"></td></tr>

<tr><td align=center> <input class=btn type="submit" name="submit" value= "Search"></td></tr>

</table>

<div id="ResultsHolder"></div>

</form>
</body>
</html>

 
hello, anybody can help me?? It's the first time that i work with Style Sheet and I test this code that it's an easy S-Control and the Style don't work. I add the code for if somebody know where is the problem.
 
Thanks and best regards!
 
 
 
 

Hi,
 
I want to know the length of a list, I'm use the next code. Does anybody know where is the error?
 
Thanks and best regards
Code:
<script src="http://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script> 
<script> 

function initPage ( ) { 
sforceClient.registerInitCallback (setupPage); 
sforceClient.init ( "{!API_Session_ID}" , "{!API_Partner_Server_URL_70}" ); 
} 

function setupPage ( ) { 
cuenta ='{!Account_Name}'; 
var queryResult = sforceClient.query("Select Id from Opportunity where Account =' "+cuenta+" ' and StageName = 'Ganada' ", false); 
var e =[]; 
e = queryResult; 
alert ('Test: '+e.length); 
} 

 
Hi all,
 
now i try to create a SControl where the result are a fields of the result object and I whant that this results are a link to the object. Does somebody  know how can i do this? 
 
Thanks, and best regards!
 
Elena
Does someone know if Data Loader to Professional Edition exists?
 
Thanks and Best Regards
 
Elena
Hi, Anybody Know what is the proble in this code?? I'm new in SalesForce and don't get anything...
Please help me!!!
 
The code is:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Crear Una Cuenta</title>
</head>
<body >
<script language="javascript" src="https://www.sforce.com/ajax/beta1/sforceclient.js" type="text/javascript"></script>
<script language="javascript">
 
Account objMyaccount = new Account();
objMyaccount.setName("Koka Kola"); 
objMyaccount.setWebsite("www.kokakola.com");
 
sObject[] records = new sObject[] {objMyaccount };  
SaveResult[] saveResults = sfdc.create(records);
String newID = saveResults[0].id;
if (saveResults[0].getSuccess())
          {
           // No errors, so we will retrieve the id created for this index
           System.out.println("Attachment with id " + saveResults[0].getId());
          }
        else
          {
            System.out.println("Error during creation of attachment " + saveResults[0].getErrors());
          }
</body>
</html>
 
Thanks!!!!
Hi,
I want to create an account and to asing the values of one lead. Now I do a easy test but It does not work. Anybody can say me whats it's the problem in my code? The code is:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Convertir Candidatos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body>
 
<script language="javascript">
//NTR des SControl Duplicar Contrato v1 .html
//THE WEB LINK MUST BE OPENED IN THE SAME WINDOW
  
var sfdc = new ActiveXObject('SForceOfficeToolkit.SForceSession');
sfdc.SetServerUrl('{!API_Enterprise_Server_URL_50}');
sfdc.SessionId = '{!API_Session_ID}';
   
var leadId = '{!Lead_ID}';
var qrs = sfdc.Query("Select * from Lead where Id = '"+leadId+"'", false)
var e = new Enumerator(qrs);
var sobj = e.item();
  
    
var newCItems = new Array(1);
newCItems[0] = sfdc.CreateObject("Account");
var e2 = new Enumerator(newCItems);
var sobj2 = e2.item();
    
document.writeln("<strong>WAIT PLEASE............................</strong><BR>");
//Lead Information:
sobj2.item('Name').value = 'NameAccount';
sobj2.item('Phone').value = sobj.item('MobilePhone').value;
sobj2.item('CreatedById').value = sobj.item('CreatedById').value;
document.writeln("<strong>...................OK......................</strong><BR>");
if (sfdc.Error == 0) {
     sobj2 = newCItems[0];
     var idNuevoContrato = sobj2.item('Id').value;
     
}else{
     alert("ERROR : Salesforce.com cannot duplicate the contract");
    }
</script>
</body>
</html>
 
 
Thanks!!!

Message Edited by ElenaCapta on 06-07-2006 03:41 AM