• finky
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 8
    Replies
Can anyone tell what's wrong with this syntax:

"Where PostalMailingCode Like '10019%'"

This crashes my entire HTML S-Control even though I know there are Contacts with that zip code.

Full Query:

Code:
//*********** Query ***********************************
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a " +
"Where PostalMailingCode Like '10019%'" +
"limit 10");

 


  • December 14, 2007
  • Like
  • 0
Using the Ajax toolkit I've created an HTML S-Control that uses the API to retreive certain Contacts.  I have also modified the code to retreive the parent Account Name (lifted from toolkit samples).

My problem is that the table renders and does not fail but I can't find the right field name to display the Contact's Account.

Any ideas?  I'm totally new to S-Controls and Java. 

Here's my query:

var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +

"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +

"FROM Contact c, c.account a limit 10");

and here's the line where I try to display results:

sb.append("</td><td> ").append(editLink(record, "a.Name"));

I've tried many names, but nothing displays the Account Name


Here's the full code:
Code:
<html>
<!--
Generated by AJAX tools
Date : Thu Dec 13 2007 10:48:29 GMT-0500 (Eastern Standard Time)
Template : listview.html by manoj@cheenath.com
SControl : DummyContact
-->

<html>

<head><title>listview</title>

<link rel="shortcut icon" href="/favicon.ico"/>
<script src="/soap/ajax/8.0/connection.js"></script>
<script src="/js/dojo/0.3.1/dojo.js"></script>
<title>DummyContact</title>

<style>
table {
font-family: Lucida Grande, Verdana;
font-size: 0.8em;
width: 100%;
border: 1px solid #ccc;
cursor: default;
}

* html div.tableContainer {
/* IE only hack */
width: 95%;
border: 1px solid #ccc;
height: 285px;
overflow-x: hidden;
overflow-y: auto;
}

table td,
table th {
border-right: 1px solid #999;
padding: 2px;
font-weight: normal;
}

table thead td, table thead th {
background: #94BEFF;
}

* html div.tableContainer table thead tr td,
* html div.tableContainer table thead tr th {
/* IE Only hacks */
position: relative;
top: expression( dojo.html.getFirstAncestorByTag(this, 'table').parentNode.scrollTop-2);
}

html>body tbody.scrollContent {
height: 262px;
overflow-x: hidden;
overflow-y: auto;
}

tbody.scrollContent td, tbody.scrollContent tr td {
background: #FFF;
padding: 2px;
}

tbody.scrollContent tr.alternateRow td {
background: #e3edfa;
padding: 2px;
}

tbody.scrollContent tr.selected td {
background: yellow;
padding: 2px;
}

tbody.scrollContent tr:hover td {
background: #a6c2e7;
padding: 2px;
}

tbody.scrollContent tr.selected:hover td {
background: #ff3;
padding: 2px;
}
</style>

<script type="text/javascript">
dojo.require("dojo.widget.SortableTable");
dojo.addOnLoad(displayTable);


function displayTable() {

//*********** Query ***********************************
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a limit 10");

//*********** creates Title Header *********************
var sb = new sforce.StringBuffer();
sb.append("<tr>");
sb.append("<td>No</td>");

sb.append("<td>LastName</td>");

sb.append("<td>FirstName</td>");

sb.append("<td>Phone</td>");
sb.append("<td>Title</td>");
sb.append("<td>Account</td>");

sb.append("<td>Email</td>");

sb.append("</tr>");

//**************** fills table with query results *******

while (true) {
if (result.size > 0) {
for (i = 0; i < result.records.length; i++) {
var record = result.records[i];
sb.append("<tr><td>").append(i).append("</td>");

sb.append("</td><td> ").append(editLink(record, "LastName"));

sb.append("</td><td> ").append(editLink(record, "FirstName"));

sb.append("</td><td> ").append(editLink(record, "Phone"));
sb.append("</td><td> ").append(editLink(record, "Title"));
sb.append("</td><td> ").append(editLink(record, "a.Name")); 
sb.append("</td><td> ").append(editLink(record, "Email"));

sb.append("</td></tr>");
}
}
if (result.done == "true") {
break;
} else {
result = sforce.connection.queryMore(result.queryLocator);
}
}
document.getElementById("list-view-table").innerHTML = sb.toString();
}


function editLink(record, field) {
var value = record[field];
value = value — value : "&nbsp;";
return value;

//todo: edit link
return "<a href='javascript&colon; editCell(\"" + record.Id +
"\",\"" + field + "\",\"" + value + "\")'>" +
value + "</a>";
}


function editCell(id, field, value) {
var newVal = prompt("Enter new text", value);
if (newVal === null || newVal === value) {
alert("Field not changed");
return;
} else {
value = newVal;
}
var record = new sforce.SObject("Account");
record.Id = id;
record[field] = value;

try {
result = sforce.connection.update([record]);
if (result[0].getBoolean("success") == false) {
alert("update failed");
} else {
//initPage();
}
} catch (e) {
alert("update failed");
//sforce.debug.display(e);
}
}
</script>
</head>

<body>

<div class="tableContainer">

<table dojoType="SortableTable" id="list-view-table"
headClass="fixedHeader" tbodyClass="scrollContent"
enableMultipleSelect="true" enableAlternateRows="true"
rowAlternateClass="alternateRow" cellpadding="0" cellspacing="0" border="0">
</table>
</div>

</body>
</html>

 Here's the results with the Account column blank:

  • December 14, 2007
  • Like
  • 0
The whole purpose of using a web-based CRM is that it's available to use anywhere you can use the internet. Unfortunately SFDC changed the rules on us SEVERELY limiting it's utility while still charging the same.

I thought that I'd have to go through the Challenge process once to authorize my laptop.  Unfortunately, using  my Verizon wireless card  (or using any wifi service on the road, ie Starbucks, etc) you'll have to do this every time you want to log-on.  And, by the way, I have no way to access my corporate email on my laptop, so the Challenge email goes to my office computer, not my laptop. 

This is totally unacceptable

I would be willing to validate each new computer once.  There should be a way to authorize the machine (ie home computer, or laptop) once and only once.  A RSA keyfob, or Bloomberg fingerprint validator, or downloaded software application (I know, I know - "no software!")  would all be acceptable, but it seems like SFDC is trying do this on the cheap

Finky
  • December 10, 2007
  • Like
  • 0
Is it possible to write a Validation Rule that tests formula (i.e. calculated) fields?  It seems that one can only use writable fields in a Rule.

I have multiple entry fields and formula fields in my Opportunity Object.  For example, there are three sub-sections that a user could use:

Custom field 1 + Custom field 2 = Formula Field A
Custom field 3 + Custom field 4 = Formula Field B
Custom field 5 + Custom field 6 = Formula Field C

Users should only enter data into one sub-section (ie fields 1&2 or3&4 or 5&6).  I want to create Validation Rule that tests to see if Fields A, B or C are greater than zero.  If it is, the user entered data into more than one sub-section (a no-no).

I'm sure there are more complicated/elegant solutions (ie different page layouts based on the sub-section selected), but I thought a validation rule would be the quickest without changing page layouts, permissions, etc. 

Thanks in advance

Finky
  • December 05, 2007
  • Like
  • 0
While Installling Eclipse>Help>Software Updates>Find and Install > I selected Callisto and Force.com external sites  Relating to Force.com, I get the error message:

Apex Eclipse Toolkit (8.0.2002) requires plug-in "org.apache.axis"


Any ideas on how to find/install this plug in?

Finky


  • November 15, 2007
  • Like
  • 0
Setup>Customize>Integrate>API contains the following instructions and  a link to download a WSDL file

Salesforce's WSDL allows you to easily integrate Salesforce with your applications, and to build new applications that work with Salesforce. To get started, download a WSDL file to a place accessible to your development environment.

How/where do I save the webpage that is returned after clicking the link?

Finky
  • November 15, 2007
  • Like
  • 0
My problem is this.  When in Opportunities, I use an S-Control to launch a custom object (Ticket) in edit mode.  The Ticket pre-populates with several fields from the master Opportunity filled in.  One of the fields is Selling Concession. 

My question is, is it possible to update the Selling Concession field on the Ticket if it has changed on the master Opportunity? 

I'm not really an Apex programmer yet, and I'm using Professional Edition (considering upgrading to EE), but would like to see how I can do this. 

If it is not possible to dynamically link the fields, is it possible to update the value when I take a certain action or run certain code?

Thanks in advance
  • August 23, 2007
  • Like
  • 0
I"m following the tutorial in Creating On-Demand Applications with AppExhange found on the web.  Chapter 6, p 79 instructs me to dowload a zip file from www.salesforce.com/developer/devguide.  The tutorial states that the zip file contains 3 .csv files:  Positions.csv, Candidates.csv and JobApplications.csv.

In reality, the zip file does not contain the JobApplicants  file.  Does anyone know why?

Also, does this tutorial Recruiting app work for those with Professional  edition?

Dave
  • February 02, 2007
  • Like
  • 0
Can anyone tell what's wrong with this syntax:

"Where PostalMailingCode Like '10019%'"

This crashes my entire HTML S-Control even though I know there are Contacts with that zip code.

Full Query:

Code:
//*********** Query ***********************************
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a " +
"Where PostalMailingCode Like '10019%'" +
"limit 10");

 


  • December 14, 2007
  • Like
  • 0
Using the Ajax toolkit I've created an HTML S-Control that uses the API to retreive certain Contacts.  I have also modified the code to retreive the parent Account Name (lifted from toolkit samples).

My problem is that the table renders and does not fail but I can't find the right field name to display the Contact's Account.

Any ideas?  I'm totally new to S-Controls and Java. 

Here's my query:

var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +

"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +

"FROM Contact c, c.account a limit 10");

and here's the line where I try to display results:

sb.append("</td><td> ").append(editLink(record, "a.Name"));

I've tried many names, but nothing displays the Account Name


Here's the full code:
Code:
<html>
<!--
Generated by AJAX tools
Date : Thu Dec 13 2007 10:48:29 GMT-0500 (Eastern Standard Time)
Template : listview.html by manoj@cheenath.com
SControl : DummyContact
-->

<html>

<head><title>listview</title>

<link rel="shortcut icon" href="/favicon.ico"/>
<script src="/soap/ajax/8.0/connection.js"></script>
<script src="/js/dojo/0.3.1/dojo.js"></script>
<title>DummyContact</title>

<style>
table {
font-family: Lucida Grande, Verdana;
font-size: 0.8em;
width: 100%;
border: 1px solid #ccc;
cursor: default;
}

* html div.tableContainer {
/* IE only hack */
width: 95%;
border: 1px solid #ccc;
height: 285px;
overflow-x: hidden;
overflow-y: auto;
}

table td,
table th {
border-right: 1px solid #999;
padding: 2px;
font-weight: normal;
}

table thead td, table thead th {
background: #94BEFF;
}

* html div.tableContainer table thead tr td,
* html div.tableContainer table thead tr th {
/* IE Only hacks */
position: relative;
top: expression( dojo.html.getFirstAncestorByTag(this, 'table').parentNode.scrollTop-2);
}

html>body tbody.scrollContent {
height: 262px;
overflow-x: hidden;
overflow-y: auto;
}

tbody.scrollContent td, tbody.scrollContent tr td {
background: #FFF;
padding: 2px;
}

tbody.scrollContent tr.alternateRow td {
background: #e3edfa;
padding: 2px;
}

tbody.scrollContent tr.selected td {
background: yellow;
padding: 2px;
}

tbody.scrollContent tr:hover td {
background: #a6c2e7;
padding: 2px;
}

tbody.scrollContent tr.selected:hover td {
background: #ff3;
padding: 2px;
}
</style>

<script type="text/javascript">
dojo.require("dojo.widget.SortableTable");
dojo.addOnLoad(displayTable);


function displayTable() {

//*********** Query ***********************************
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a limit 10");

//*********** creates Title Header *********************
var sb = new sforce.StringBuffer();
sb.append("<tr>");
sb.append("<td>No</td>");

sb.append("<td>LastName</td>");

sb.append("<td>FirstName</td>");

sb.append("<td>Phone</td>");
sb.append("<td>Title</td>");
sb.append("<td>Account</td>");

sb.append("<td>Email</td>");

sb.append("</tr>");

//**************** fills table with query results *******

while (true) {
if (result.size > 0) {
for (i = 0; i < result.records.length; i++) {
var record = result.records[i];
sb.append("<tr><td>").append(i).append("</td>");

sb.append("</td><td> ").append(editLink(record, "LastName"));

sb.append("</td><td> ").append(editLink(record, "FirstName"));

sb.append("</td><td> ").append(editLink(record, "Phone"));
sb.append("</td><td> ").append(editLink(record, "Title"));
sb.append("</td><td> ").append(editLink(record, "a.Name")); 
sb.append("</td><td> ").append(editLink(record, "Email"));

sb.append("</td></tr>");
}
}
if (result.done == "true") {
break;
} else {
result = sforce.connection.queryMore(result.queryLocator);
}
}
document.getElementById("list-view-table").innerHTML = sb.toString();
}


function editLink(record, field) {
var value = record[field];
value = value — value : "&nbsp;";
return value;

//todo: edit link
return "<a href='javascript&colon; editCell(\"" + record.Id +
"\",\"" + field + "\",\"" + value + "\")'>" +
value + "</a>";
}


function editCell(id, field, value) {
var newVal = prompt("Enter new text", value);
if (newVal === null || newVal === value) {
alert("Field not changed");
return;
} else {
value = newVal;
}
var record = new sforce.SObject("Account");
record.Id = id;
record[field] = value;

try {
result = sforce.connection.update([record]);
if (result[0].getBoolean("success") == false) {
alert("update failed");
} else {
//initPage();
}
} catch (e) {
alert("update failed");
//sforce.debug.display(e);
}
}
</script>
</head>

<body>

<div class="tableContainer">

<table dojoType="SortableTable" id="list-view-table"
headClass="fixedHeader" tbodyClass="scrollContent"
enableMultipleSelect="true" enableAlternateRows="true"
rowAlternateClass="alternateRow" cellpadding="0" cellspacing="0" border="0">
</table>
</div>

</body>
</html>

 Here's the results with the Account column blank:

  • December 14, 2007
  • Like
  • 0
Setup>Customize>Integrate>API contains the following instructions and  a link to download a WSDL file

Salesforce's WSDL allows you to easily integrate Salesforce with your applications, and to build new applications that work with Salesforce. To get started, download a WSDL file to a place accessible to your development environment.

How/where do I save the webpage that is returned after clicking the link?

Finky
  • November 15, 2007
  • Like
  • 0
hi all,
 
i got an error message saying : request failed with http status 407: proxy authentication required(ISA server requires authorization to fulfill the request. access to the web proxy filter is denied )
whenever i try to run apex explorer.
 
what changes should i make into tools-> options to make it run properly?
 
thanks,
mahi
  • November 14, 2007
  • Like
  • 0
Hello everyone. 
I am in need of some help creating a S-Control.  I am the Admin for my company but do not have much programming experience.  I am trying to create a process in the opportunity tab that will create a new record in in a related custom object when the user saves a new opportunity.  The new record on the custom (related) object will contain data from 3 fields in the opportunity.  I was told that an S-Control can achieve this.  If anyone can lead me in the right direction, it would be greatly appreciated. 

Thank you in advance,
sfmoose
My problem is this.  When in Opportunities, I use an S-Control to launch a custom object (Ticket) in edit mode.  The Ticket pre-populates with several fields from the master Opportunity filled in.  One of the fields is Selling Concession. 

My question is, is it possible to update the Selling Concession field on the Ticket if it has changed on the master Opportunity? 

I'm not really an Apex programmer yet, and I'm using Professional Edition (considering upgrading to EE), but would like to see how I can do this. 

If it is not possible to dynamically link the fields, is it possible to update the value when I take a certain action or run certain code?

Thanks in advance
  • August 23, 2007
  • Like
  • 0