• steph1source
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 13
    Replies
I have an scontrol that essentially clones an opportunity and set's some specific values in some of our custom fields. One of the fields that is being cloned is the a custom field that is a long text area but the script seems to error out everytime there is a record that has carriage returns in this field. Is there something special that needs to be done with long text are fields? I am simply using the following syntax to grab the value from the old record and then to set it in the cloned oppty:
to get the value:

var osnote = "{!SFDC_520_Quote__c.OS_NoteOld__c}";

and then to set it in the new oppty:

upd.set("OSNote__c",osnote );

 

thanks for any help!

I have an scontrol that is taking the value from a date field (Sub Start Date) and putting that value into another date field (Sub Start Date2). I then have a calculated field that compares the values in these two fields so that I can determine whether the user has changed the value in Sub Start Date since hitting the link for the scontrol. The problem I am having is with the date format. I have a user in the UK who tested the scontrol and after he hit the link the value in the Sub Start Date2 is stored as 11/4/2007 on the database. The value in Sub Start Date is 4/11/2007 and so my calculated field incorrectly declares them as different. How do I get the scontrol to store the date in Sub Start Date2 as m-d-yyyy like Sub Start Date instead of using the user's locale? This is the code that I have right now:
 

var substartdate = new Date("{!SFDC_520_Quote__c.Subscription_Start_Date__c}");

upd.set("Subscription_Start_Date2__c",substartdate);

 

thanks

Stephanie

Has anyone seen a way to bypass the template selection page when performing a mail merge? We have a custom objct that we will do a mail merge from but the template will always be the same and we would love to hard code the template into the mail merge button somehow..thanks in advance!

When a custom lookup relationship is created is the Id of the record chosen in the lookup available for use in an scontrol? For example, on our custom object Quote I have a lookup relationship called System Administrator which does a lookup to Contact. I wanted to use a S-Control to pull in additional information about the Contact chosen in this field but I do not seem to be able to access the Id so that I can retrieve more info. Any ideas how I could do this? in the case of my example The System_Administrator__c lookup field just contains that name of the Contact not the ID.

thanks for your help!

I am not sure where to post this but I am having an issue with the Print Anything module from AppExchange. I have a package built that pulls opportunity data as well as data from the related lists on the opportunity page layout. The package works great when my link has the debug mode turned on..my template appears and all of the merge fields have data. However as soon as I take out the debug parameter the merge no longer works and no data is shown in my template. Any ideas? Here are the links that I have:
 
this one works:
Hyperlink(/servlet/servlet.Integration?lid=01N400000004bvV&package=a05400000028vOQ&opportunityId={!Opportunity.Id}&debug=1)
 
this one does not:
Hyperlink("/servlet/servlet.Integration?lid=01N400000004bvV&package=a05400000028vOQ&opportunityId={!Opportunity.Id}")
Hello all,
 
We just went live with salesforce and I will be administering the application. We already have requirements for functionality that I believe will require scontrols. Which means I need to quickly learn javascript! Can anyone provide advice on training programs or other resources that I can use?
 
thanks!
I have an scontrol that essentially clones an opportunity and set's some specific values in some of our custom fields. One of the fields that is being cloned is the a custom field that is a long text area but the script seems to error out everytime there is a record that has carriage returns in this field. Is there something special that needs to be done with long text are fields? I am simply using the following syntax to grab the value from the old record and then to set it in the cloned oppty:
to get the value:

var osnote = "{!SFDC_520_Quote__c.OS_NoteOld__c}";

and then to set it in the new oppty:

upd.set("OSNote__c",osnote );

 

thanks for any help!

Hi All,

Have written a s-control that returns a formatted list of assets for the account associated with a case.  I have hit a problem where no results are displayed if there is only one result returned.  >1 results render fine. 


Code:
<html>

<head>
<script src="/soap/ajax/10.0/connection.js"></script>

<script>

function initPage() {
var result = sforce.connection.query("Select Id, Name, Quantity, Support_Level__c, UsageEndDate from Asset Where AccountId = '{!Case.AccountId}' and UsageEndDate > today ");
var sb = new sforce.StringBuffer();
sb.append("<b>Current Assets for {!Account.Name}</b><br>");
sb.append("<hr>");
sb.append("<center><table width=90%><tr><td>Name</td><td>Qty</td><td>Support Level</td><td>End Date</td></tr>");

while (true) {
if (result.size > 0) {
for (i = 0; i < result.records.length; i++) {
var account = result.records[i];
sb.append("<tr>"); //<td>").append(i).append("</td>");
sb.append("</td><td> ").append(account.Name);
sb.append("</td><td> ").append(account.Quantity);
sb.append("</td><td><center> ").append(account.Support_Level__c);
sb.append("</td><td> ").append(account.UsageEndDate);
sb.append("</td></tr>");
}
}
if (result.done == "true") {
break;
} else {
result = sforce.connection.queryMore(result.queryLocator);
}
}
sb.append("</table>");
document.body.innerHTML = sb.toString();
}

</script>
</head>

<body onload="initPage();">
</body>

</html>

 Any and all help is appreciated.

-Michael

Hello all:
I created a custom sControl and placed it in the opportunity section.  This SControl populates all the Opportunity's Account contacts in a drop-down list.  Anyways, it's simple and not a lot of HTML to display.
When i add that SControl to the page layout, it adds a lot of white space below the actual SControl and it does not look good at all!
Any thoughts on how i can get rid of that white space?
Thanks for your replies!
Frederic

When a custom lookup relationship is created is the Id of the record chosen in the lookup available for use in an scontrol? For example, on our custom object Quote I have a lookup relationship called System Administrator which does a lookup to Contact. I wanted to use a S-Control to pull in additional information about the Contact chosen in this field but I do not seem to be able to access the Id so that I can retrieve more info. Any ideas how I could do this? in the case of my example The System_Administrator__c lookup field just contains that name of the Contact not the ID.

thanks for your help!

I installed this application in my test environment, now I can't find it on the App Exchange. What happened?
Thanks, CindyF
  • March 09, 2007
  • Like
  • 0
I have created an scontrol in javascript that clones an opportunity and closes out the current oppty. It clones about 35 fields on the oppty record as well as any line items and any contact roles.
 
The whole process is taking about 16 seconds to run. So I started taking out my queries (to get account name (for use in oppty name), line items and contact roles) one by one to see how much they were slowing things down. What I saw was that even with no queries it was taking 8 seconds and then each of the queries added about 3 seconds each.
 
I am wondering if this is normal response time? If I should paste my code here for people to see then let me know. I am new to javascript and so perhaps there is something that I could be doing differently. Any help would be great!
 
Also - Is there a way to display on the screen something like 'Creating Renewal Oppty. Please Wait....' while it is doing all of the processing?
 
thanks!
  • September 07, 2006
  • Like
  • 0
I am not sure what just happened there but here is my question..probably a very easy question but I am new to javascript. I have an scontrol written in javascript and I am getting the value from a date field this way:
 
var OpptyCloseDate = {!Opportunity_Renewal_Close_Date};
 
I am then trying to put this variable into a the Close Date of a newly created oppty...using this:
 
 newoppty.set("CloseDate", OpptyCloseDate);
 
What am I missing? I am getting an error. SUrely I need to do something with the dates I just have no idea what!
 
thanks!

Message Edited by sgorema on 08-30-2006 12:19 PM

If you try to create a standard object record (account, contact etc..) specifying an inactive ownerId, the API complains loudly and the record is rejected. This is fair enough.

If you try to create a custom object record specifying an inactive ownerId, then the API happily creates the record returning an ID. I would prefer it to complain and reject the record.

Is this a subtle design feature of API 4.0?