• Kringo
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
I'm a admin with a couple years under my belt trying to learn some of this code stuff. I've been working on this piece for a few hours (i'm embarressed to say how many) and I'm stuck. I've posted the code. What I'm trying to do is use an inline scontrol to display account site info in a record that is at the detail end of a relationship with account.
Code:
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Account</title>

<!-- Include the SalesForce style sheets -->
<link href="/sCSS/Theme2/en/common.css
media="handheld,print,projection,screen,tty,tv" rel="stylesheet"
type="text/css" />
<link href="/sCSS/10.0/Theme2/allCustom.css"
media+"handheld,print,projection,screen,tty,tv" rel="stylesheet"
type="text/css" />

<-- get the AJAX toolkit -->
<script src="/soap/ajax/10.0/connection.js"></script>
<script>

var AccountId= "{!Service__c.Account__c}";

function failure(error) {
document.body.innerHTML += "Error retrieving Account info";
document.body.innerHTML += "<br>API Error: " + error;
}

function initPage() {

try{
//alert(AccountId);
var result = sforce.connection.retrieve("Account_Site, Owner","Account" [AccountId],
{onSuccess: render, onFailure: failure});

} catch (e) {
document.body.innerHTML += "Error retrieving Account info";
document.body.innerHTML += "<br>Fault code: " + e.faultcode;
document.body.innerHTML += "<br>Fault string: " + e.faultstring;

}

}

function render(result) {

try {

var record = result [0];

var output = "<div class='bPageBlock secondaryPalette' id='ep'>";

output += "<div class='pbHeader'>";
output += "<div class='pbBody'>";
output += "<div class='pbSubsection' style='display: block;'>"


output += "<tr>";
output += "<td class='labelCol'>Account</td>"
output += "<td class='dataCol col02'><a target='_top' href=/"
+ AccountId + ">" + record.Account_Name + "</a></td>"
<td class='labelCol empty'> </td>
<td class='dataCol empty'> </td>";
output += "</tr>";
output += "<tr>";
output += "<td class='labelCol'>Account Site </td>";
output += "td class='dataCol'>" + Account.Site + "</td>";
output += "</tr></table>";
output += "</div></div></div><div class='pbFooter
secondaryPalette'><div class='bg'/></div></div>';



document.body.innerHTML += output;

} catch (e) {
document.body.innerHTML += "Error retrieving candidate information";
document.body.innerHTML += "<br>Fault code: " + e.faultcode;
document.body.innerHTML += "<br>Fault string: " + e.faultstring;
}
}
</script>
</head>
<body class="custom customTab79 detailPage" onload="initPage();">
<div id="mainbody"></div>
</body>
</html>

 

any nudge in the right direction would be much appreciated
  • October 26, 2007
  • Like
  • 0
Hi,
 
I have a question about use special characters in opportunity name:
 
 
I created an opportunity which has double quotation " and the prime ', the name is:
 
 
special"ABC'123/\*
 
 
Now I want to use this name in my S-Control which is using HTML code, actually
I want to remove the speical characters,  to make it as
 
specialABC123
 
But if I put the above string in a Javascript function like this:
 
var str = "{!Opportunity.name}"                      or   var str = '{!Opportunity.name}' 
 
 
Since  {!Opportunity.name} only replaces the whole string directly
without encoded or escaped, the string is like this:
 
"special"ABC'123/\*"                                       or  'special"ABC'123/\*'
    
 
None of them could work properly because either the double quotation " should be
escaped as \" or the prime should be escaped as \' to make the Javasrcipt string
as a valid string.
 
Does anybody know how to use the opportunity name string  as encoded or escaped?
The only way I know how to use it is:
 
{!Opportunity.name}
 
but this does not work properly in the above case.
 
 
 
Thanks.
 
 
 
 
 
 
 
I want to carry fields from a parent object to the child object when the user clicks the new button.
 
I have created a URL to update the code.  I put it on a seperate button called update and it works after the record has been created but now I want it to work when a new one is created.
 
What code do I use to override the next step of selecting the proper record type? 
 
I want the user to still select the record type then when they get to the edit screen have the fields populated.
  • February 05, 2008
  • Like
  • 0
I'm a admin with a couple years under my belt trying to learn some of this code stuff. I've been working on this piece for a few hours (i'm embarressed to say how many) and I'm stuck. I've posted the code. What I'm trying to do is use an inline scontrol to display account site info in a record that is at the detail end of a relationship with account.
Code:
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Account</title>

<!-- Include the SalesForce style sheets -->
<link href="/sCSS/Theme2/en/common.css
media="handheld,print,projection,screen,tty,tv" rel="stylesheet"
type="text/css" />
<link href="/sCSS/10.0/Theme2/allCustom.css"
media+"handheld,print,projection,screen,tty,tv" rel="stylesheet"
type="text/css" />

<-- get the AJAX toolkit -->
<script src="/soap/ajax/10.0/connection.js"></script>
<script>

var AccountId= "{!Service__c.Account__c}";

function failure(error) {
document.body.innerHTML += "Error retrieving Account info";
document.body.innerHTML += "<br>API Error: " + error;
}

function initPage() {

try{
//alert(AccountId);
var result = sforce.connection.retrieve("Account_Site, Owner","Account" [AccountId],
{onSuccess: render, onFailure: failure});

} catch (e) {
document.body.innerHTML += "Error retrieving Account info";
document.body.innerHTML += "<br>Fault code: " + e.faultcode;
document.body.innerHTML += "<br>Fault string: " + e.faultstring;

}

}

function render(result) {

try {

var record = result [0];

var output = "<div class='bPageBlock secondaryPalette' id='ep'>";

output += "<div class='pbHeader'>";
output += "<div class='pbBody'>";
output += "<div class='pbSubsection' style='display: block;'>"


output += "<tr>";
output += "<td class='labelCol'>Account</td>"
output += "<td class='dataCol col02'><a target='_top' href=/"
+ AccountId + ">" + record.Account_Name + "</a></td>"
<td class='labelCol empty'> </td>
<td class='dataCol empty'> </td>";
output += "</tr>";
output += "<tr>";
output += "<td class='labelCol'>Account Site </td>";
output += "td class='dataCol'>" + Account.Site + "</td>";
output += "</tr></table>";
output += "</div></div></div><div class='pbFooter
secondaryPalette'><div class='bg'/></div></div>';



document.body.innerHTML += output;

} catch (e) {
document.body.innerHTML += "Error retrieving candidate information";
document.body.innerHTML += "<br>Fault code: " + e.faultcode;
document.body.innerHTML += "<br>Fault string: " + e.faultstring;
}
}
</script>
</head>
<body class="custom customTab79 detailPage" onload="initPage();">
<div id="mainbody"></div>
</body>
</html>

 

any nudge in the right direction would be much appreciated
  • October 26, 2007
  • Like
  • 0
    Hi all, It would probably drive you nuts that a Product guy who doesn't know how to code is snooping around the dev network, but i have a question about an s-control.

I have created some custom objects and need to map the field on one object to a field on another.

One custom object is named "Item"  It has a field called "Item Number".  I would like to get that Item Number to map to another custom object named "Line Item."

I do not know how to write code, but i can pick out the pieces.  This code would be very helpful as there are other places I need the same functionality. 

Can someone help me out? I would be much obliged.
Hi all.  I've been able to override Edit and Delete buttons.  But when I override the New button (on a child object), I just get a blank i-Frame, but no errors as shown on the status bar with an exclamation point.  I've attached the "View Source" from the i-Frame.  It seems it sees the script, but just doesn't want to execute it.  Any ideas?
 
Code:
<script  type="text/javascript">function getRecordIds(keyPrefix) { return [] }</script>
<script  type="text/javascript">this.__sfdcSessionId = 'URg3C3XdgX6J6zgBrjXUW9dKBYWdvmYiuDA1IIbxSiYw8wdSoYUAe9XIY4n4389T.Ps8ktT1SsV3Fh3TalS5iFtm0eZXn.oO3HqtZiMtDQ_9WR0F2VSOzr1Vmttbk__IheJaNwCU'</script>
<script type="text/javascript">
alert("I'm starting");
if("Approved" == "Approved" && "Product Pricing Exception" == "Product Pricing Exception")
{
//go to the standard detail page
alert("Sorry, once a Sales Exception is in Approved status, New is not authorized.");
window.parent.location.href = "/a0860000002BlLN/d";
}
else
{
//go to the standard new page
alert("New!");
window.parent.location.href = "/setup/ui/recordtypeselect.jsp—ent=01I600000009SXk&retURL=%2Fa0860000002BlLN%2Fd&save_new_url=%2Fa08%2Fe%3FretURL%3D%252Fservlet%252Fservlet.Integration%253Flid%253D01NT00000004Ig1%2526eid%253Da0O%2526ic%253D1%2526CF00NT0000000ijhA%253DPreferred%252BPlus%252BDiscount%2526CF00NT0000000ijhA_lkid%253Da0860000002BlLN%2526scontrolCaching%253D1%2526retURL%253D%25252Fa0860000002BlLN%2526RecordType%253D012T00000004KRI%2526cancelURL%253D%25252Fa0860000002BlLN%2526ent%253D01IT0000000Cjpa%2526save_new%253D1%2526autoMapValues%253D1&nooverride=1";
}

 
Hi,
 
I've looked through communities and I think this is maybe a feature which is being developed for the next release, but wondered if anyone knows of a way to do this in the mean time.
 
I have created an s-control to create a custom object, prepopluating it with certain fields from both the contacts and accounts objects.  This is working great.  However, I have now added a custom lookup field to the contacts object.  I want to get details from this lookup object but I can't seem to reference it in any way apart from the name or id.
 
Is this currently possible?  Is there a way to reference the fields of a lookup object?
 
Thanks
 
Sandra
Hello,
I am a new user, and I am not a computer programmer.
I am trying to import a 3-column price list into SF Pro.  1) Part #, 2) Part Description, 3) Price.
 
I thought this would be simple  So far I have been given a 6-page .pdf that makes no sense for what I am trying to do.  It says I have to use the Excel Connector to import products into the Products 2  table, ensure that each product is linked to a Pricebook ID, and then import into a price book entry table.
 
Sounds good, except I have no idea what any of that means.  I was able to get the Excel add-in for Salesforce connector to work, that seems to be important in the forums I have read.
 
Is there any manual, or procedure available for importing a simple 3-column price list, that a lowly Marketing Manager guy could understand?
 
Thanks for any assistance.