• MANATTWeb
  • NEWBIE
  • 35 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 14
    Replies
I am wanting to ensure a user fills out a Win/Loss section when the Opporunity Stage is Closed Won or Closed Lost with the following Validation Rule. It isn't working and since this is my first try at a validation rule, I'm not sure why. Any help would be appreciated.

( ISPICKVAL( Workflow_Stage__c , "Closed Won")  || ISPICKVAL( Workflow_Stage__c , "Closed Lost") ) && ( ISPICKVAL( Reason__c , "") ||  ISPICKVAL(  Result__c  , "") || ISBLANK(  W_L_Competitors__c ) ||   ISBLANK(W_L_Notes__c) )

I'm trying to create a simple contact form that e-mails the form contents to a specific address. The e-mail is being sent just fine, but the variables I'm using in my controller code aren't being set by the actionFunction prior to sending out the e-mail. Here's the code for form:

 

<apex:outputPanel id="contactFormArea">
    <apex:form id="emailform" rendered="{!Not(sent)}" >
        <table width="100%" border="0" cellspacing="0" cellpadding="4" class="css3Box">
    	    <tr>
       		<td width="23%" align="right" valign="top" class="page-content">Name:</td>
        	<td width="77%" align="left" valign="top"><apex:outputText value="{!yourname}" id="yourname" styleClass="page-content" /></td>
    	    </tr>
            <tr>
        	<td align="right" valign="top" class="page-content">E-Mail:</td>
        	<td align="left" valign="top"><apex:inputText value="{!youremail}" id="youremail" maxlength="80" size="40" styleClass="page-content" /></td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Phone:</td>
        	<td align="left" valign="top"><apex:inputText value="{!yourphone}" id="yourphone" maxlength="80" size="40" styleClass="page-content" /></td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Category:</td>
        	<td align="left" valign="top">
           	    <apex:selectList id="subject" size="1" >
            	        <apex:selectoption itemLabel="Site Issue/Problem" itemValue="Problem"></apex:selectoption>
            	        <apex:selectoption itemLabel="Question" itemValue="Question"></apex:selectoption>
     		    </apex:selectList>    
        	</td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Message:</td>
        	<td align="left" valign="top"><apex:inputTextarea value="{!body}" id="body" rows="6" cols="40" styleClass="page-content" /></td>
   	    </tr>
    	    <tr>
                <td align="right" valign="top">&nbsp;</td>
        	<td align="left" valign="top"><apex:commandButton value="SEND" id="sendButton" onclick="sendEmail();"/></td>
    	    </tr>
	</table>			
	<apex:actionFunction name="sendEmail" action="{!sendIt}" reRender="contactFormArea" immediate="true">
		<apex:param name="youremail" assignTo="{!youremail}" value=""/>
		<apex:param name="yourphone" assignTo="{!yourphone}" value=""/>
		<apex:param name="subject" assignTo="{!subject}" value=""/>
		<apex:param name="body" assignTo="{!body}" value=""/>
	</apex:actionFunction>
    </apex:form>
    <apex:outputPanel rendered="{!(sent)}">
    <table width="100%" border="0" cellspacing="0" cellpadding="4" class="css3Box">
	<tr>
	    <td>e-mail sent</td>
	</tr>
    </table>
    </apex:outputPanel>
</apex:outputPanel>

 And here's the controller code:

// Constructor
	public MIQ_ContactExtensionController(ApexPages.StandardController stdController) {
		sent = false;
		yourname = userInfo.getName();
	}

	public PageReference sendIt() {
	 params = ApexPages.CurrentPage().getParameters();
         system.debug('+++++++++++++++++++++++++++++++++++++++++++Params: '+params);

// Define the email Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] { 'steve.manatt@acxiom.com' }; if (yourphone == '') { yourphone = 'N/A'; } // Sets the paramaters of the email email.setSubject( subject ); email.setToAddresses( toAddresses ); email.setPlainTextBody( 'From: ' + yourname + ' (' + youremail + ') \n\n\r' + 'Subject: ' + subject + '\n\n\r' + 'Message: ' + body + '\n\n\r' ); // Sends the email Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); sent = true; system.debug('++++++++++++++++++++++++++++++++++++e-mail: '+youremail); return null; }

 The debug logs for "params" show the form values being sent in the form of "jcref.emailform.youremail=test@test.com"; however, the param variable "youremail" is blank.

 

This really doesn't seem like something very hard, but I've spent two+ days on it. I sure hope someone out there can spot the problem.

 

Thanks in advance.

Has anyone had success displaying video on a VF page by using the embed code from a CDN like Limelight? Here's the code they provide:

 

<span class="LimelightEmbeddedPlayer"><script src="http://assets.delvenetworks.com/player/embed.js"></script><object type="application/x-shockwave-flash" id="limelight_player_393753" name="limelight_player_393753" class="LimelightEmbeddedPlayerFlash" width="800" height="360" data="http://assets.delvenetworks.com/player/loader.swf"><param name="movie" value="http://assets.delvenetworks.com/player/loader.swf"/><param name="wmode" value="window"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="flashVars" value="deepLink=true&amp;playerForm=LVPPlayerHorizontalPlaylist&amp;channelId=59affe0988334bbb82412775fd75c62c"/></object><script>LimelightPlayerUtil.initEmbed('limelight_player_393753');</script></span>

 

The player shows up, but it doesn't play and the play button does nothing.

 

I'm sure I'm missing something and any bit of help would be appreciated.

I used the code snippets found in THIS POST and the search works for both Firefox and Chrome, but IE simply refreshes the page and a second press on the search button moves the user over to the Content Search page without the parameters in the Search box.

 

What is it with IE that would cause this behavior and how do I overcome it?

 

EDIT: This seems to be something with the way the browser is being forwarded. IE doesn't process the OUTPUT PANEL on the first button press. A second press does get this to work; however, the protocol and host have to be hard coded for IE to work - at least in my case.

 

So, the question becomes why doesn't IE process the outputpanel on the first button press?

Is it possible to configure your personal Chatter posts to be automatically posted to one or more groups?

I am wanting to ensure a user fills out a Win/Loss section when the Opporunity Stage is Closed Won or Closed Lost with the following Validation Rule. It isn't working and since this is my first try at a validation rule, I'm not sure why. Any help would be appreciated.

( ISPICKVAL( Workflow_Stage__c , "Closed Won")  || ISPICKVAL( Workflow_Stage__c , "Closed Lost") ) && ( ISPICKVAL( Reason__c , "") ||  ISPICKVAL(  Result__c  , "") || ISBLANK(  W_L_Competitors__c ) ||   ISBLANK(W_L_Notes__c) )

I'm trying to create a simple contact form that e-mails the form contents to a specific address. The e-mail is being sent just fine, but the variables I'm using in my controller code aren't being set by the actionFunction prior to sending out the e-mail. Here's the code for form:

 

<apex:outputPanel id="contactFormArea">
    <apex:form id="emailform" rendered="{!Not(sent)}" >
        <table width="100%" border="0" cellspacing="0" cellpadding="4" class="css3Box">
    	    <tr>
       		<td width="23%" align="right" valign="top" class="page-content">Name:</td>
        	<td width="77%" align="left" valign="top"><apex:outputText value="{!yourname}" id="yourname" styleClass="page-content" /></td>
    	    </tr>
            <tr>
        	<td align="right" valign="top" class="page-content">E-Mail:</td>
        	<td align="left" valign="top"><apex:inputText value="{!youremail}" id="youremail" maxlength="80" size="40" styleClass="page-content" /></td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Phone:</td>
        	<td align="left" valign="top"><apex:inputText value="{!yourphone}" id="yourphone" maxlength="80" size="40" styleClass="page-content" /></td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Category:</td>
        	<td align="left" valign="top">
           	    <apex:selectList id="subject" size="1" >
            	        <apex:selectoption itemLabel="Site Issue/Problem" itemValue="Problem"></apex:selectoption>
            	        <apex:selectoption itemLabel="Question" itemValue="Question"></apex:selectoption>
     		    </apex:selectList>    
        	</td>
    	    </tr>
    	    <tr>
        	<td align="right" valign="top" class="page-content">Message:</td>
        	<td align="left" valign="top"><apex:inputTextarea value="{!body}" id="body" rows="6" cols="40" styleClass="page-content" /></td>
   	    </tr>
    	    <tr>
                <td align="right" valign="top">&nbsp;</td>
        	<td align="left" valign="top"><apex:commandButton value="SEND" id="sendButton" onclick="sendEmail();"/></td>
    	    </tr>
	</table>			
	<apex:actionFunction name="sendEmail" action="{!sendIt}" reRender="contactFormArea" immediate="true">
		<apex:param name="youremail" assignTo="{!youremail}" value=""/>
		<apex:param name="yourphone" assignTo="{!yourphone}" value=""/>
		<apex:param name="subject" assignTo="{!subject}" value=""/>
		<apex:param name="body" assignTo="{!body}" value=""/>
	</apex:actionFunction>
    </apex:form>
    <apex:outputPanel rendered="{!(sent)}">
    <table width="100%" border="0" cellspacing="0" cellpadding="4" class="css3Box">
	<tr>
	    <td>e-mail sent</td>
	</tr>
    </table>
    </apex:outputPanel>
</apex:outputPanel>

 And here's the controller code:

// Constructor
	public MIQ_ContactExtensionController(ApexPages.StandardController stdController) {
		sent = false;
		yourname = userInfo.getName();
	}

	public PageReference sendIt() {
	 params = ApexPages.CurrentPage().getParameters();
         system.debug('+++++++++++++++++++++++++++++++++++++++++++Params: '+params);

// Define the email Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] { 'steve.manatt@acxiom.com' }; if (yourphone == '') { yourphone = 'N/A'; } // Sets the paramaters of the email email.setSubject( subject ); email.setToAddresses( toAddresses ); email.setPlainTextBody( 'From: ' + yourname + ' (' + youremail + ') \n\n\r' + 'Subject: ' + subject + '\n\n\r' + 'Message: ' + body + '\n\n\r' ); // Sends the email Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); sent = true; system.debug('++++++++++++++++++++++++++++++++++++e-mail: '+youremail); return null; }

 The debug logs for "params" show the form values being sent in the form of "jcref.emailform.youremail=test@test.com"; however, the param variable "youremail" is blank.

 

This really doesn't seem like something very hard, but I've spent two+ days on it. I sure hope someone out there can spot the problem.

 

Thanks in advance.

Hi,
I want to autofill one of the text field (Description text box)  when account code is selected. Following is the VFPage and a Controller. I am not getting any of the result when I select the accout code.  This is quite simple I belive, but I dont know where I am wrong. Please help me!
*********VFPage*********
<apex:page standardController="Fin_Journal__c" extensions="Fin_LineManager">
        
    <script src="../../soap/ajax/24.0/connection.js" type="text/javascript"></script>
    <script type="text/javascript">
        function getDescription()
        {    
            var queryresult = sforce.connection.query("SELECT Description__c FROM Code_Combination__c WHERE Name = '" + document.getElementById('{!$Component.MyForm:acc}').value + "'", queryresult);            
            var records = queryresult.getArray('records');
            document.getElementById('{!$Component.MyForm:desc}').value = records [0].Description__c;
        }
    </script>
      
    <apex:form id="MyForm">
         <b>
         <table>
             <tr>
                <td><apex:outputLabel >Account&nbsp;Code: </apex:outputLabel></td>
                <td><apex:inputField id="acc" value="{!newline.Code_Combination__c}" style="width:320px" onselect="{getDescription()}"/></td>
             </tr>
             <tr>   
                <td><apex:outputLabel >Description:&nbsp;&nbsp;&nbsp;&nbsp;</apex:outputLabel></td>
                <td><apex:inputField id="desc"  value="{!newline.Description__c}" style="width:320px"/></td>
             </tr>
             <tr>   
                <td></td>
                <td><apex:commandButton action="{!save}" value="Save" /></td>
             </tr>
         </table>
         </b>                         
    </apex:form>
</apex:page>
*********CONTROLLER*********
public class Fin_LineManager
    public Line__c newLine {get; set;}
   
    public Fin_LineManager(ApexPages.standardController stdn)
    {
       newLine  = new Line__c(Journal__c = ApexPages.currentPage().getParameters().get('id'));
    }   
    
    
    public PageReference Save()
    {            
       insert newLine;
       return null ;        
    }    
}
Regards,
Meer Salman

I have a weird problem on a VF page.  There's some buttons that query for data that take a while.  For about 10-15 seconds, the browser status line ways "Waiting for cs12.salesforce.com".  Then for 5-10 seconds the status line says "Transferring data from cs12.salesforce.com".  If  I press another button on the page while this transferring data is going on, I get an error.  The request somehow calls the page's controller constructor again without some needed parameters, and then the controller throws a message because the data isn't available?

 

Anyone else experience this?  It's quite annoying.  I don't want to tell my uses "hands off the keyboard while the page is loading."  They'll never get it right.

 

My guess is that during the data transfer part, the view state hasn't yet been copied to the browser.  So pressing another button makes another request for the page with no view state so it tries to serve it from scratch.  Not sure what to do about.

 

By the way, I did try using apex:actionFunction and rerender which does an AJAX request but in this case there's a log of data and I got horrid performance.  It took five to seven times as long to load the same amount of data.

 

 

Has anyone had success displaying video on a VF page by using the embed code from a CDN like Limelight? Here's the code they provide:

 

<span class="LimelightEmbeddedPlayer"><script src="http://assets.delvenetworks.com/player/embed.js"></script><object type="application/x-shockwave-flash" id="limelight_player_393753" name="limelight_player_393753" class="LimelightEmbeddedPlayerFlash" width="800" height="360" data="http://assets.delvenetworks.com/player/loader.swf"><param name="movie" value="http://assets.delvenetworks.com/player/loader.swf"/><param name="wmode" value="window"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="flashVars" value="deepLink=true&amp;playerForm=LVPPlayerHorizontalPlaylist&amp;channelId=59affe0988334bbb82412775fd75c62c"/></object><script>LimelightPlayerUtil.initEmbed('limelight_player_393753');</script></span>

 

The player shows up, but it doesn't play and the play button does nothing.

 

I'm sure I'm missing something and any bit of help would be appreciated.

I have a basic quote app that generates a PDF from Visualforce markup. One of the field in the quote needs to be calculated from data in the quote. I hit a wall with JavaScript. This won’t even write "test":

 

<script language="text/javascript">

document.write("Test");

</script>

 

Also I’m not to clear on how to interact with Visualforce variables in JavaScript, do I need to use the brackets and exclamation point? Is what I am trying to do even possible?

 

Thanks in advanced,

David Orazine

Hi All,

 

One of my client want to access Chatter as custom application from their existing website. As a solution I am building custom application, which will be accessed by all customers from client website.

My solution is based on standard chatter object and custom VisualForce pages. Now we can use Chatter Plus or Force.com license for all customers.

 

If anybody has some experience or idea about Chatter Plus license over Force.com license then let me know.

 

 

 

 How do I get the second line to show if the Contract.Est_Labor_Hours__c number field is not null?  I've tried it a couple of different ways, but I can't get the line to display when there is something in there.

 

 

<apex:outputField rendered="{!IF(Contract.Est_Labor_Hours__c != null,'','display:none;')}">

Project Manager: {!ROUND(Contract.Est_Labor_Hours__c,0)}</apex:outputField>

 

I'm working with an htc file to style my visualforce pages. The problem is that the .htc file needs to live on the server that the html pages are being served from. I am unable to reference this file, or figure a means to make it work. I tried using:

 

{!URLFOR($Resource.DomainCss, 'style/PIE.htc')}  - this doesn't work somehow. No paths or sheets are recognized using this method of getting resources, whether looking for .css, .js, or .htc files. ( Actually, the example for URLFOR doesn't seem to work either... )

 

So I wrote a line for each stylesheet:

 

{!$Resource.Master}, {!$Resource.Secondary}, {!$Resource.Typo}, etc. and all files are found and serve their purpose. 

 

But.. I cannot get the .htc file to be seen. ( This is IE only, btw. ) I am using PIE.htc and cannot find a way to include the file in a meaningful way. Has anyone else ever tried or seen this done?

 

Thanks much in advance.

 

b

  • May 03, 2011
  • Like
  • 0

I'm trying to put a simple text search box on a VF page that, when submitted, will redirect the user to the CRM Content search page along with the search term.  I can "hack the URL" manually to accomplish this.  For example, if I put /sfc/#search?searchTerm=blah in my browser, it behaves correctly.  however, I can't seem to get a visualforce page to redirect similarly.

 

Here's my controller code:

 

public with sharing class SalesPlaybookHomeController {

	public String searchString {get;set;}
	
	private final String path = '/sfc/#search';
	
	public PageReference search() {
        String queryString = '';
       //build the query string
        if (searchString != null && searchString.length() > 0){
            queryString = 'searchTerm=' + EncodingUtil.urlEncode(searchString, 'UTF-8');
        }
        PageReference p = new PageReference(path + '?' + queryString);
        p.setRedirect(true);
        return p;
    }
}

 

 

When the code executes, it redirects to the content page, but the query string is not there, and so the searchTerm is not passed correctly.

 

Is there a different way to formulate the URL in order to effect a CRM Content search?  Other ideas?

 

Thanks in advance,
Cory

  • January 12, 2011
  • Like
  • 0