• Asymtek
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies

I inherited an S-Control with JavaScript that is mimicking the clone button. I am a real newbie with JavaScript .  I have pinpointed the source of the program bombing to the fact that a text field has spaces. Of course the Users must have their spaces.  I learned that I need urlencode but I do not know the format. Can someone help me along?

//ESR Quote Notes
(needs additional code to eliminate spaces)
url +="&00N30000001J1Il="+"{!ESR__c.ESR_Quote_Notes__c}";

 This piece is giving me an error because it is copying the isocode and the value, e.g.., USD 10.00.  How do I strip out the isocode?

//Set ESR Quote Price (because of setting currency)
url +="&00N30000001J1fo="+"{!ESR__c.ESR_Quote_Price__c}";

 

Button Code in its entirety

<html>
<head>
<script type="text/javascript"
src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/connection.js"></script>
<script language="JavaScript">

function redirect()
{
returnURL = "%2F{!ESR__c.Id}";
cancelURL = "%2F{!ESR__c.Id}";
url="";
url += "/a00/e?retURL="+returnURL;
url +="&cancelURL="+cancelURL;

//Set ESR Factory
url +="&00N30000001cZ14="+"{!ESR__c.Factory__c}";
//Set ESR Name and ID
url +="&CF00N30000002FftR="+"{!ESR__c.Name}";
url +="&CF00N30000002FftR_lkid="+"{!ESR__c.Id}";
//Set ESR Account
url +="&CF00N30000001JncQ="+"{!ESR__c.Account__c}";
url +="&CF00N30000001JncQ_lkid="+"{!ESR__c.AccountId__c}";
//Set ESR Opportunity
url +="&CF00N30000001JPji="+"{!ESR__c.Opportunity__c}";
url +="&CF00N30000001JPji_lkid="+"{!ESR__c.OpportunityId__c}";
//Set ESR Territory to Account Territory
url +="&00N30000001J1LH="+"{!ESR__c.Territory__c}";
//Set ESR Descriptions Elements
url +="&00N30000001J1aW="+"{!ESR__c.Description_of_Problem__c}";
url +="&00N30000002Fft8="+"{!ESR__c.Suggested_Solution__c}";
url +="&00N30000002Fft9="+"{!ESR__c.Supporting_Information__c}";
//Set ESR Qty
url +="&00N30000001J1jn="+"{!ESR__c.ESR_Qty__c}";
//Set Model Platform
url +="&00N30000001J1bk="+"{!ESR__c.Model_Platform__c}";
//Set Valve 1
url +="&00N30000002Fftg="+"{!ESR__c.Valve_1__c}";
//Set Valve 2
url +="&00N30000002Ffth="+"{!ESR__c.Valve_2__c}";
//Set ESR Lead time
url +="&00N30000001J1iB="+"{!ESR__c.ESR_Lead_Time__c}";
//Set DataFlo Number and Description
url +="&00N30000001J1fW="+"{!ESR__c.DataFlo_Number__c}";
url +="&00N30000001J1fH="+"{!ESR__c.DataFlo_Description__c}";
//ESR Repeat Order requote checkbox
url +="&00N30000001J1ia="+"1";
//Set Assembly Lead Time
url +="&00N30000001J1iG="+"{!ESR__c.Assembly_Lead_Time__c}";
//Complete And Accurate
url +="&00N30000002Ffuo="+"{!ESR__c.Complete_and_Accurate__c}";
//Set ESR Quote Price
url +="&00N30000001J1fo="+"{!ESR__c.ESR_Quote_Price__c}";
url +="&01I300000009XYi="+"{!ESR__c.CurrencyIsoCode }";
//ESR Quote Notes
url += "&00N30000001J1iL="+"{!ESR__c.ESR_Quote_Notes__c}";

parent.frames.location.replace(url);
}

redirect();

</script >

</head>

<body>
</body>
</html>

My goal is to allow the User to download or display a simple PDF file stored in SF Documents folder to reference while they are entering products on quote line items or the opportunity line items. So it needs to reside or stay open on the page while they enter products. Like a pop-up I guess.

 

So I created a custom button with the link to the document https://na6.salesforce.com/servlet/servlet.FileDownload?file=01580000000zkMY. Now I want to control how it is displayed

 

After all my review of pop up windows and the like, it looks like my answer is javascript but I don't know how to do it.  Can anyone help?

I need help in creating a formula that maintains a rolling 3 month and 6 month average qty of products sold.  I want to display these two results in a column at the end of a matrix report.

 

 

Columns:       Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 3MonAve 6MonAve

 

Rows:

Product A       

Product B

Product C

 

Has anyone done this?

I am looking for a formula or validation rule that would help me prevent the user from skipping a stage. 

I want to create a new clone button that doesn't poplulate all the fields of the standard clone button. Does anyone have the apex code behind the standard one that I can copy and modify?