• ElenaCapta
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 10
    Replies
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