• John Neff
  • NEWBIE
  • 320 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 65
    Questions
  • 86
    Replies
Hi,

I am looking to bulk delete all records that I have added to my custom object. Could someone please suggest a way that I can do this?

Thanks, Emma

Hello, 
 

I am trying to build a "Copy To Clipboard" button for one of my VF pages. 

I found the code below on GitHub (will attribute author at bottom), but it displays the text to be copied in an output field.  The functionality works just as I want it to, but I don't want to display the text, I just want to store it behind the button.  Can anyone help me convert the OutPutPanel portion to a stored variable?  I've been playing around with this for a while and can't figure it out. 

Here is the code: 
 

<apex:page title="Clipboard Test" >
<apex:messages />
    <script language="JavaScript">
        function ClipBoard(copytextid, holdtextid){
            copyToClipboard(copytextid);
        }
        function copyToClipboard(elementId) {
          // Create an auxiliary hidden input
          var aux = document.createElement("input");
          // Get the text from the element passed into the input
          aux.setAttribute("value", document.getElementById(elementId).innerHTML);
          // Append the aux input to the body
          document.body.appendChild(aux);
          // Highlight the content
          aux.select();
          // Execute the copy command
          document.execCommand("copy");
          // Remove the input from the body
          document.body.removeChild(aux);
        }    
    </script>   
    <apex:pageblock >
    <apex:form >
        <apex:outputpanel ID="copytext" STYLE="height:150;width:162;background-color:pink">
            TEXT TO BE COPIED
        </apex:outputpanel> 
        <apex:inputtextarea ID="holdtext" STYLE="display:none;"></apex:inputtextarea>
        <apex:commandbutton onClick="ClipBoard('{!$Component.copytext}', '{!$Component.holdtext}');" rerender="copytext" value="Copy to Clipboard"/> 
    </apex:form>
    </apex:pageblock>
</apex:page>
**Source: https://gist.github.com/nithesh1992/dc66708bde9ab94313a731a715fef9ad#file-copy-txt

I want to accomplish something like this:
 
<apex:variable ID="copytext" value="TEXT TO BE COPIED" "/>
            
      
        <apex:inputtextarea ID="holdtext" STYLE="display:none;"></apex:inputtextarea>
        <apex:commandbutton onClick="ClipBoard('{!$Component.copytext}', '{!$Component.holdtext}');" rerender="copytext" value="Copy to Clipboard"/>

So that the only visable piece is the button.  Can anyone help me with this?!

Thank you, and happy thanksgiving!
Hello, 

I am trying to write a test class for a VF controller, and I am getting an error saying the variable does not exist even though it does!  Why would this be happening? 

Here is my controller: 
 
public class DailySalesReportController{ 

        public List<Opportunity> listOfCefOpToday {get;set;}
        public List<Opportunity> listOfLoganOpToday {get;set;}
        public List<Lead> listOfCefLdToday {get;set;}
        public List<Lead> listOfLoganLdToday {get;set;}
        public List<Sales_Meetings__c> listOfCefSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfCefOcToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganOcToday {get;set;}
        public Opportunity CefOpToday {get;set;}
        public Opportunity LoganOpToday {get;set;}
        public Lead CefLdToday {get;set;}
        public Lead LoganLdToday {get;set;}
        public Sales_Meetings__c CefSkedToday {get;set;}
        public Sales_Meetings__c LoganSkedToday {get;set;}
        public Sales_Meetings__c CefOcToday {get;set;}
        public Sales_Meetings__c LoganOcToday {get;set;}
    
    public DailySalesReportController(){
        listOfCefOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        
        
}
}

And here is my test: 
 
@isTest(seeAllData = true)
public class DailySalesReportControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your Opportunity record with required field
        //Opportunity b = new Opportunity(Created_Today__c = TRUE);
        //insert b;
        test.startTest();
           DailySalesReportControllerTest ub = new DailySalesReportControllerTest();
           
           if(ub.listOfCefOpToday!=null && !ub.listOfCefOpToday.isEmpty())
           Opportunity cefOpportunity = ub.listOfCefOpToday.get(0);
           
           if(ub.CefOpToday !=null)
            String CefOpTodayId = ub.CefOpToday.Id;
           
        test.stopTest();
    }   
}

I keep getting this error: 
 
Error: Compile Error: Variable does not exist: listofcefoptoday at line 12 column 41

Can anyone help?  I'm really stuck here 
Hello, 

I have an apex class that functions as a VF page controller, and when I run the associated test class it passes - but when I look at the class the coverage is at 0% and it is bringing my code coverage down below 75%.  How can this be?  I would really appreciate some help here!

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   


}
}

and here is my test class: 
 
@isTest(seeAllData =  true)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

I ill be eternally grateful if someone can help me solve this!

Thank you, 

John
Hello, 

I have a controller that is showing 0% code coverage, but I'm not sure why my test class isn't covering anything.  Can anyone help? 

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   
and here is my test: 

}
}
and here is my test? 
 
@isTest(seeAllData = false)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

would anyone be willing to help me beef this up?

it would mean the world to me. 

thank you in advance!!!!!!

John 
 

Hello, 

I am attempting to use inputText on a VF page and can't figure out how to save the value to the record.  Does anyone have an example of this that I could bootstrap off of? 

I am using a custom object & controller. 
 

Here is the string from the VF page: 
 

apex:inputText value="{!spotObj.Workload__c}"/> <apex:commandButton value="Save" action="{!saveSpot}"/>
And here is my controller: 
 
public with sharing class SpotsInProcess{

    public List <Job_Number__c> listOfInProgress {get;set;}
    public Job_Number__c InProgress  {get;set;}

public PageReference saveSpot(){
    UPDATE listOfInProgress;
    return null;
    }


public SpotsInProcess(){
    listOfInProgress = [Select id, name, Workload__c, Notes__c, Thumbnail_URL__c, ISCI__c, Title__c,   First_Air_Date__c,  Last_Air_Date__c, Project__c, Campaign__r.Name, Nets_Running__c, View_Link__c, Internal_Title__c, Legal__c, Airing_Agencies__c from Job_Number__c where Job_Status__c = 'In Progress']; 
}
}

It would mean the world to me if someone could help me out!

Thanks in advance! 
 
Hello, 

I am using apex:outputLink on a vf page to open a new window - but it is refreshing my original page upon click.  Is there a way to stop this?  Here is my link. 
 
<apex:outputLink onclick="window.open('AllSpotsMoreDetails?id={!spotObj.Id}', 'newwindow', 'width=800, height=900')"> More Details</apex:outputLink>

Thanks, 

John

 
Hello, 

I am having trouble with In-line edit functionality that I developed 6 months ago or so... at some point in the past couple of weeks it has stopped working.  Has there been some sort of update or something that would cause a piece of functionality to just stop working?  Here is an example of a place where I am using inline edit: 

on VF page: 
<apex:form > 
           <apex:pageBlock title="Qualified" mode="inlineedit">
             <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1120" border="1">
                <tr>
                      
                </tr>
                <apex:variable var="QualRev" value="{!0}"/>
                <apex:repeat value="{!listOfQualified}" var="qd">
                                                                         <tr >
                                  
                            
                              
                            <td width="450">
                                <apex:outputField value="{!qd.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                                                   
                            

                        </tr>
                               
            </table> 
            <apex:commandButton action="{!saveQD}" value="Update Opptys"/>
            </apex:pageBlock>
           </apex:form>

and on my controller: 
 
public PageReference saveQD(){
    UPDATE listOfQualified;
    return null;
    }

This setup worked for months - but then stopped.  I can't figure out why! Can anyone help? 

Thanks, 

John
 
Hello, 

I have a vf page (version 35.0) and controller with inline edits on one of my output fields, and my edits are not saving for some reason. 

Here is the pageblock where the inline edit resides: 
<apex:form >
    <apex:pageBlock title="{!camp}">
     <table width="1130" style="table-layout:fixed" align="left" >
   <tr>
   <td width="205" style="background-color: #D8D8D8; color: #190707"><b>Thumb</b></td>
   <td width="100" style="background-color: #D8D8D8; color: #190707"><b>ISCI</b></td>
   <td width="150" style="background-color: #D8D8D8; color: #190707"><b>First Aired - Last Aired</b></td>
   <td width="100" style="background-color: #D8D8D8; color: #190707"><b>Aired by</b></td>
   <td width="500" style="background-color: #D8D8D8; color: #190707"><b>Notes</b></td>
   <td width="300" style="background-color: #D8D8D8; color: #190707"><b>Viewer</b></td>
   <td width="100" style="background-color: #D8D8D8; color: #190707"><b>More Details</b></td>
   
   
      </tr> 
      
      </table>

     <apex:repeat value="{!SPOT}" var="spotObj"> 

        <apex:outputPanel rendered="{!IF(camp=spotObj.Campaign__r.Name,true,false)}" >
     <table width="1130" style="table-layout:fixed" align="left">
      
  <tr>
    <td width="205"> <img src="{!spotObj.Thumbnail_URL__c}" WIDTH="200" HEIGHT="120" onclick="window.open('{!spotObj.View_Link__c}', 'newwindow', 'width=500, height=500')"> </img> </td>
    <td width="100">{!spotObj.ISCI__c}<br/></td>
     <td width="150"></td>
      <td width="100"></td>
    <td width="500"> <apex:outputField value="{!spotObj.Notes__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField></td>      
    <td width="300">{!spotObj.View_Link__c}</td>  
    <td width="100"><apex:outputLink onclick="window.open('AllSpotsMoreDetails', 'newwindow', 'width=800, height=900')"> More Details</apex:outputLink></td> 
    
    </tr>
  
</table>
             </apex:outputPanel>

      </apex:repeat>
      
       
    </apex:pageBlock>
    <apex:commandButton action="{!saveNotes}" value="Update Notes"/> 
</apex:form>


The field Notes__c is a Rich Text area field. 

Here is my controller: 
 
public with sharing class AllSpotController
{

public List <Job_Number__c> SPOT {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveNotes(){
    UPDATE SPOT;
    return null;
    }

public void load() 
{
  campaigns= new List<String>();
  SPOT = [Select id, name, Notes__c, Thumbnail_URL__c, ISCI__c, Title__c, Project__c, Campaign__r.Name, Nets_Running__c, View_Link__c, Internal_Title__c, Legal__c, Airing_Agencies__c from Job_Number__c where ISCI__c <> null];
  
  Set<String> campaignSet = new Set<String>();
  for (Job_Number__c j : SPOT)
      campaignSet.add(j.Campaign__r.Name);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

I have used this type of setup in the past successfully, what am I missing to make this not work? 


 
Hello, 

I am trying to create a custon button for Docusign and add a few parameters, but they don't seem to be doing anything.  

I know this borders on Answers Community vs. Developer Forum -  but I figure its worth a shot.  Here is what I have so far: 
 
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 
CES='CUSTOM SUBJECT'; 
DST='f610482c-4082-4ffb-af23-2d13962e64ae'; 
DocuSign_CreateEnvelope();


The button is creating a Docusign envelope as it should be, but the two parameters I added: "CES" and "DST" (these are parameters supplied by docusign)  are not doing anything. 

Is my syntax for adding parameters to my button correct? 

Thanks, 

John
Hello, 

I have an external vendor that is posting custom object records into my org via a SOAP POST request, and I am running into an issue where the vendor is not recieving a "Success" respone on a large number of the posts - yet the post is completing successfully. 

This is causing an issue because without a "Success" response, the post times out on the vendor side and they retry so I am ending up with a huge amount of duplicates. 

The problem here is that I have absolutely no idea how to diagnose this.  Is there somewhere where I can monitor the flow of records into my org and understand why some response messages aren't firing?  I don't even know where to start here, I would really appreciate some help. 

Thank you so much in advance. 

Regards, 

John
Hello, 

I have a VF page that is using apex:repeat to create a table column for each related object record like so:
 
<apex:repeat value="{!Quarterly_Buy__c.Media_Buys__r}" var="buys">
                     <td style="background-color: #D8D8D8; color: #190707;font-size:14px;" align="center">
                        <b>{!MONTH(buys.Broadcast_Week__c)}/{!DAY(buys.Broadcast_Week__c)}/{!VALUE(RIGHT(TEXT(YEAR(buys.Broadcast_Week__c)),2))}</b>
                    </td>

I want to add a condition where a column is only renedered if the field "Broadcast_Week__c" on the child record is greater than Today. 

I have adding a "Display" attribute to the td saying: 
 
display: {!IF(Quarterly_Buy__c.Media_Buys__r.Broadcast_Week__c < Today(), 'none', 'table-column')};"

but I am getting en error. 

Can anyone help? 

Thanks, 

John
Hello, 

I am working on creating a Contract template in visualforce, and I have to display a few numbered lists.  I am using a seperate outputtext for each item in the list, like so: 
 
<apex:outputText >
A.  Item A and corresponding text, this could wrap into a second, third, fourth, etc line.  How can I make the lines indent?
</apex:outputText>
<br/>
<br/>
<apex:outputText >
B.  Item B and corresponding text, this could wrap into a second, third, fourth, etc line.  How can I make the lines indent?
</apex:outputText>
<br/>
<br/>
<apex:outputText >
C.  Item C and corresponding text, this could wrap into a second, third, fourth, etc line.  How can I make the lines indent?
</apex:outputText>
<br/>
<br/>
<apex:outputText >
D.  Item D and corresponding text, this could wrap into a second, third, fourth, etc line.  How can I make the lines indent?
</apex:outputText>

How do I specify that when the text wraps on to a second line, it becomes indented? 

Thanks in advance!

John
Hello, 

I have a junction object called "Vendor Agreement" that is a junction between my Campaigns and a custom field object called "Vendors". 

I am trying to create a VF page that is laid out like a grid - where the Campaigns are the columns and the Vendors are the rows, and data from each Junction object populates in each cell.  For example if column 2 was the campaign "Widgets" and Row 2 was the vendor "Acme", I want to pull data from the Junction Object that exists between "Acme" and "Widgets" into Row 2, Column 2.  

Here is what I have so far, I just can not figure out how to render the data so that data is only displayed if on the Vendor Agreement object the "Vendor" lookup matches the value in column 1, and  the "Campaign" lookup matches the value in row 1. 

Am I even a little bit on the right track? 

Here is my controller: 
 
public class piPricingController{ 

    public List<Campaign> listOfOffers {get; set;}
    public List<PI_Vendor__c> listOfVendors {get; set;}
    public Campaign Offers {get; set;}
    public PI_Vendor__c Vendors {get; set;}
    
    public PageReference saveOF(){
    UPDATE listOfOffers;
    return null;
    }

public piPricingController(){ 
    listOfOffers = [Select id, name, (Select id, name, Partner_Name__c, Price_per_Call__c, Charge_Time_Threshold__c, Status__c  FROM Vendor_Addenda__r WHERE Vendor_Type__c = 'PI Vendor') FROM Campaign WHERE isActive = TRUE ORDER BY Name ASC];
    listOfVendors = [Select id, Name, (Select id, name, Partner_Name__c, Price_per_Call__c, Charge_Time_Threshold__c, Status__c  FROM Vendor_Addeda__r WHERE Vendor_Type__c = 'PI Vendor') FROM PI_Vendor__c WHERE Type__c = 'PI Vendor' ORDER BY Name Asc];

}
}

and here is my page: 
 
<apex:page controller="piPricingController">
<html>
<table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" border="1">
<tr width="450">
<td width="450"> </td>
<apex:repeat value="{!listOfOffers}" var="a">
<td width="450"> {!a.name}</td>
</apex:repeat>
</tr>
<apex:repeat value="{!listOfVendors}" var="v">
<tr>
<td width="450">{!v.name} </td>
<apex:repeat value="{!listOfOffers}" var="va">
<td width="450">DATA RENDERED IF VENDOR MATCHES VALUE IN COLUMN 1 AND CAMPAIGN MATCHES DATA IN ROW 1 </td>
</apex:repeat>
</tr>
</apex:repeat>
</table>
</html>
</apex:page>


 
Hello, 

I am trying to add UPDATE functionality to a controller and am getting the error: DML requires SObject or SObject list type: List<String>

However my variable is set up like this: public List<String> campaigns {get;set;}

I am not sure how to achieve the proper syntax here, and was hoping that someone out there in developerland would be able to help me!

Here is my (broken) controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> listOfOpty {get;set;}
public List<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE campaigns;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  listOfOpty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : listOfOpty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

Thanks in advance!

John

 
Hello - 

I have a controller with a variable that is output as an array - and I would like to use UPDATE to give my users the ability to make in-line edits to records displayed an a VF page.  Is this at all possible? 

Here is my controller:
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

I am trying to get this statement:  

 
public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

to update these records: 
 
campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ];

But the changes just won't save. 

Is there anything I can do differently to make this work? 

Thanks, 

John
Hello, 

I am trying to make an HTML table inside of a VF page sortable - but I am having some trouble. 

I am using this sample as a template: http://www.kryogenix.org/code/browser/sorttable/

And if I create a dummy page with static, dummy data this works like a charm.  Howeever if I apply this to a VF page that retruns data from a controller it doesn't work. 

When I click on a table header, the alternating "up/down" arrows appear, but the data doesn't budge.  Is there something that I need to add to my controller to make this work?

Here is my page: 
 
<script src="{!URLFOR($Resource.sorttable)}"> </script>
<meta charset="utf-8" />
<title>R2M PIPELINE</title>
<link rel="stylesheet" type="text/css" href="{!URLFOR($Resource.GUIstyle)}" media="all" />
</head>
<body>
    <div id="header">
            <div id="logo">
                <a href="index.html"><img src="{!URLFOR($Resource.Logo)}" alt="" /></a>       
            </div>
<ul>
    <li><a href="apex/GUIHome"><span>Gene</span></a></li>
                <li><a href="/apex/HappeningNow"><span>Happening Now</span></a></li>
                <li><a href="/apex/ClientDelivery"><span>Client Delivery</span></a></li>
                <li><a href="/apex/MediaCash"><span>Media Cash</span></a></li>
                <li><a href="/apex/ROIREVENUE"><span>ROI and Revenue</span></a></li> 
                <li><a href="/apex/PRODUCTION"><span>Production</span></a></li>    
                <li><a href="/apex/SalesActivity"><span>Sales Activity</span></a></li> 
                <li><a href="/apex/PIPerformance"><span>PI Performance</span></a></li>
                <li><a href="https://na2.salesforce.com/"><span>Salesforce Home</span></a></li> 
            </ul>
  </div>
    <div id="body">
        <div class="about">
            <h1>R2M Pipeline</h1>
            <div>
            
           <c:PipelineNav />


 <apex:repeat value="{!campaigns}" var="camp">

    <apex:form >
    <apex:pageBlock title="{!camp}" mode="inlineedit">
        <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1080" border="1" class="sortable" >
                
                <thead>
                <tr>
                              <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Opportunity Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Company Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="80">
                        <b>Contract Sent</b>
                                   
                    
                    </th>
                     <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b>Days Idle</b>
                    </th>
                                 
                    <th style="background-color: #C6D4D4; color: #040404" width="70">
                        <b>Created</b>
                    </th>
        <th style="background-color: #C6D4D4; color: #040404" width="450">
                        <b>Next Step</b>
                    </th>
                  
                    <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b><apex:commandLink reRender="button" onclick="window.open('/apex/Probability_Guide','','width=500,height=300')" id="button">Prob%</apex:commandLink></b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Owner</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Stage</b>
                    </th>
                
                </tr>
                </thead>
                
                 <apex:repeat value="{!Opty}" var="cs"> 
                 
                  <apex:outputPanel rendered="{!IF(camp=cs.Vert_Med__c,true,false)}" >
                  <tbody>
                      <tr>
                                  
                            <td width="100">
                                <a href="https://na2.salesforce.com/{!cs.id}">{!cs.name}</a>
                            </td>  
                              <td width="100">
                                {!cs.Company_Name__c}
                            </td> 
                                <td width="80">
                            
                               <apex:outputField value="{!cs.Contract_SENT__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                          
                           
                            <td width="50">
                                {!cs.Days_Since_Last_Modified__c}
                            </td>
                            <td width="70">
                                 {!MONTH(DATEVALUE(cs.CreatedDate))}/{!DAY(DATEVALUE(cs.CreatedDate))}/{!YEAR(DATEVALUE(cs.CreatedDate))}
                            </td>
                            
                            <td width="450">
                                <apex:outputField value="{!cs.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                           
                             <td width="50">
                                <apex:outputField value="{!cs.Probability}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                            <td width="100">
                                {!cs.Owner_Name__c}
                            </td>
                            <td width="100">
                                {!cs.StageName}
                            </td>
                          
                        </tr>
                     </tbody>
                      </apex:outputPanel>
                     </apex:repeat>
                     </table>
                     
                     <apex:commandButton action="{!saveOp}" value="Update Opptys"/>  
    </apex:pageBlock>
    </apex:form>
            <br/>
  </apex:repeat>
           
                          </div>
            <div>
                    
             </div>
            <div> </div>
        </div>
    </div>
         <div id="footer">
            <div>
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>      
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3>Social</h3>
                    <a class="facebook" href="https://www.facebook.com/pages/Ring2Media-INC/845391462194555" target="_blank">R2M Facebook</a>     
                    <a class="twitter" href="https://twitter.com/ring2media" target="_blank">R2M Twitter</a>
                </div>  
            </div>
            <div>
                            </div>
        </div>
        <style>

             .odd {

              background-color: #A4A4A4;

                }

             .even {

             background-color: #E6E6E6;

                }

            </style>
    </body>            
                  


</html>

And here is my controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

Is it possible to achieve what I am trying to accomplish with this method?

Thanks, 

John
Hello, 

I have a controller that I use to dynamically group opportunities by a picklist field and display them on a VF page, and I would like to add the ability for my users to edit the opportunities from the page but I am having trouble getting it all to fit together. Can anyone help?

Here is my controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

I think it has something to do with my variable being a string?

Here is the pageblock where I am displaying the data:
<apex:repeat value="{!campaigns}" var="camp">

    <apex:form >
    <apex:pageBlock title="{!camp}" mode="inlineedit">
        <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1080" border="1" class="sortable" >
                
                <thead>
                <tr>
                              <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Opportunity Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Company Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="80">
                        <b>Contract Sent</b>
                                   
                    
                    </th>
                     <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b>Days Idle</b>
                    </th>
                                 
                    <th style="background-color: #C6D4D4; color: #040404" width="70">
                        <b>Created</b>
                    </th>
        <th style="background-color: #C6D4D4; color: #040404" width="450">
                        <b>Next Step</b>
                    </th>
                  
                    <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b><apex:commandLink reRender="button" onclick="window.open('/apex/Probability_Guide','','width=500,height=300')" id="button">Prob%</apex:commandLink></b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Owner</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Stage</b>
                    </th>
                
                </tr>
                </thead>
                
                 <apex:repeat value="{!Opty}" var="cs"> 
                 
                  <apex:outputPanel rendered="{!IF(camp=cs.Vert_Med__c,true,false)}" >
                  <tbody>
                      <tr>
                                  
                            <td width="100">
                                <a href="https://na2.salesforce.com/{!cs.id}">{!cs.name}</a>
                            </td>  
                              <td width="100">
                                {!cs.Company_Name__c}
                            </td> 
                                <td width="80">
                            
                               <apex:outputField value="{!cs.Contract_SENT__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                          
                           
                            <td width="50">
                                {!cs.Days_Since_Last_Modified__c}
                            </td>
                            <td width="70">
                                 {!MONTH(DATEVALUE(cs.CreatedDate))}/{!DAY(DATEVALUE(cs.CreatedDate))}/{!YEAR(DATEVALUE(cs.CreatedDate))}
                            </td>
                            
                            <td width="450">
                                <apex:outputField value="{!cs.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                           
                             <td width="50">
                                <apex:outputField value="{!cs.Probability}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                            <td width="100">
                                {!cs.Owner_Name__c}
                            </td>
                            <td width="100">
                                {!cs.StageName}
                            </td>
                          
                        </tr>
                     </tbody>
                      </apex:outputPanel>
                     </apex:repeat>
                     </table>
                     
                     <apex:commandButton action="{!saveOp}" value="Update Opptys"/>  
    </apex:pageBlock>
    </apex:form>
            <br/>
  </apex:repeat>

Is there any hope for me??

Thanks in advance!

John

 
Hello, 

I have a controller which includes serveral UPDATE statements - however I am running into a code coverage error and I think it is because my UPDATE is not covered in my test class.  I tried to add it but I ran into an error.  What is the best way for me to beef up the test class for the controller below?  Thanks in advance!
 
CLASS:

public class R2MPipeLineController{

    public List<Opportunity> listOfLive {get; set;}
    public List<Opportunity> listOfViability {get; set;}
    public List<Opportunity> listOfLaunchPad {get; set;}
    public List<Opportunity> listOfContractSent {get; set;}
    public List<Opportunity> listOfQualified {get; set;}
    public Opportunity Live {get; set;}
    public Opportunity Viability {get; set;}
    public Opportunity LaunchPad {get; set;}
    public Opportunity ContractSent {get; set;}
    public Opportunity Qualified {get; set;}
    
    public PageReference saveCS(){
    UPDATE listOfContractSent;
    return null;
    }
    
    public PageReference saveVI(){
    UPDATE listOfViability;
    return null;
    }
    
    public PageReference saveLP(){
    UPDATE listOfLaunchPad;
    return null;
    }
    
    public PageReference saveQD(){
    UPDATE listOfQualified;
    return null;
    }
    
    public String getName(){
        return 'R2MPipeLineController';
        }
    
public R2MPipeLineController() {
    listofLive = [Select id, name, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Live' ORDER BY Weeks_Live__c DESC];
    listOfViability = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Viability' ORDER BY Days_Since_Last_Modified__c DESC];
    listOfLaunchPad = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Launch Pad' ORDER BY Days_Since_Last_Modified__c DESC];
    listOfContractSent = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c, Contract_Age__c from Opportunity WHERE StageName = 'Contract Sent' ORDER BY Contract_Age__c ASC];
    listOfQualified = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Qualified' ORDER BY Probability DESC]; 

}
}

And here is my test class: 
 
@isTest(seeAllData = false)
public class R2MPipeLineControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Opportunity o = new Opportunity(StageName = 'Qualified');
        //insert o;
        test.startTest();
           R2MPipeLineController qo = new R2MPipeLineController();
        test.stopTest();
    }   
}

 
Hello, 

I would like to create a hyperlink on one of my VF pages where upon click a new window opens that is 500px X 500px.  This will be for a "Help topic" - but I can not seem to figure out how to force the hyperlink to open in a new window and not a new tab.  

I tried using something like this: 
<b><apex:outputLink onclick="window.open(URL,'/apex/Probability_Guide','width=500,height=500')">Prob%</apex:outputLink></b>

And the new window is opening properly, but the page displayed in the new window is just a repeat of the page where the link resides.  How do I direct the new window to open /apex/Probability_Guide?

Thanks in advance!

John
 
Hello, 

I have inlineedit enabled on a pageBlock, is there a way that I can control the size of the inputtext box that appears when a value is dblclicked?
 
<apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />

I have a Text Area field displayed in this pageBlock, however when a user double-clicks the value the input text box shrinks down to a standard 255 character text field.  Is there a way that I can override that behaivor?

User-added image


 
Hello, 

I am having trouble with In-line edit functionality that I developed 6 months ago or so... at some point in the past couple of weeks it has stopped working.  Has there been some sort of update or something that would cause a piece of functionality to just stop working?  Here is an example of a place where I am using inline edit: 

on VF page: 
<apex:form > 
           <apex:pageBlock title="Qualified" mode="inlineedit">
             <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1120" border="1">
                <tr>
                      
                </tr>
                <apex:variable var="QualRev" value="{!0}"/>
                <apex:repeat value="{!listOfQualified}" var="qd">
                                                                         <tr >
                                  
                            
                              
                            <td width="450">
                                <apex:outputField value="{!qd.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                                                   
                            

                        </tr>
                               
            </table> 
            <apex:commandButton action="{!saveQD}" value="Update Opptys"/>
            </apex:pageBlock>
           </apex:form>

and on my controller: 
 
public PageReference saveQD(){
    UPDATE listOfQualified;
    return null;
    }

This setup worked for months - but then stopped.  I can't figure out why! Can anyone help? 

Thanks, 

John
 
Hello, 

I have a controller which includes serveral UPDATE statements - however I am running into a code coverage error and I think it is because my UPDATE is not covered in my test class.  I tried to add it but I ran into an error.  What is the best way for me to beef up the test class for the controller below?  Thanks in advance!
 
CLASS:

public class R2MPipeLineController{

    public List<Opportunity> listOfLive {get; set;}
    public List<Opportunity> listOfViability {get; set;}
    public List<Opportunity> listOfLaunchPad {get; set;}
    public List<Opportunity> listOfContractSent {get; set;}
    public List<Opportunity> listOfQualified {get; set;}
    public Opportunity Live {get; set;}
    public Opportunity Viability {get; set;}
    public Opportunity LaunchPad {get; set;}
    public Opportunity ContractSent {get; set;}
    public Opportunity Qualified {get; set;}
    
    public PageReference saveCS(){
    UPDATE listOfContractSent;
    return null;
    }
    
    public PageReference saveVI(){
    UPDATE listOfViability;
    return null;
    }
    
    public PageReference saveLP(){
    UPDATE listOfLaunchPad;
    return null;
    }
    
    public PageReference saveQD(){
    UPDATE listOfQualified;
    return null;
    }
    
    public String getName(){
        return 'R2MPipeLineController';
        }
    
public R2MPipeLineController() {
    listofLive = [Select id, name, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Live' ORDER BY Weeks_Live__c DESC];
    listOfViability = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Viability' ORDER BY Days_Since_Last_Modified__c DESC];
    listOfLaunchPad = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Launch Pad' ORDER BY Days_Since_Last_Modified__c DESC];
    listOfContractSent = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c, Contract_Age__c from Opportunity WHERE StageName = 'Contract Sent' ORDER BY Contract_Age__c ASC];
    listOfQualified = [Select id, name, Amount, Projected_Revenue__c, CreatedDate, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE StageName = 'Qualified' ORDER BY Probability DESC]; 

}
}

And here is my test class: 
 
@isTest(seeAllData = false)
public class R2MPipeLineControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Opportunity o = new Opportunity(StageName = 'Qualified');
        //insert o;
        test.startTest();
           R2MPipeLineController qo = new R2MPipeLineController();
        test.stopTest();
    }   
}

 

Hello, 
 

I am trying to build a "Copy To Clipboard" button for one of my VF pages. 

I found the code below on GitHub (will attribute author at bottom), but it displays the text to be copied in an output field.  The functionality works just as I want it to, but I don't want to display the text, I just want to store it behind the button.  Can anyone help me convert the OutPutPanel portion to a stored variable?  I've been playing around with this for a while and can't figure it out. 

Here is the code: 
 

<apex:page title="Clipboard Test" >
<apex:messages />
    <script language="JavaScript">
        function ClipBoard(copytextid, holdtextid){
            copyToClipboard(copytextid);
        }
        function copyToClipboard(elementId) {
          // Create an auxiliary hidden input
          var aux = document.createElement("input");
          // Get the text from the element passed into the input
          aux.setAttribute("value", document.getElementById(elementId).innerHTML);
          // Append the aux input to the body
          document.body.appendChild(aux);
          // Highlight the content
          aux.select();
          // Execute the copy command
          document.execCommand("copy");
          // Remove the input from the body
          document.body.removeChild(aux);
        }    
    </script>   
    <apex:pageblock >
    <apex:form >
        <apex:outputpanel ID="copytext" STYLE="height:150;width:162;background-color:pink">
            TEXT TO BE COPIED
        </apex:outputpanel> 
        <apex:inputtextarea ID="holdtext" STYLE="display:none;"></apex:inputtextarea>
        <apex:commandbutton onClick="ClipBoard('{!$Component.copytext}', '{!$Component.holdtext}');" rerender="copytext" value="Copy to Clipboard"/> 
    </apex:form>
    </apex:pageblock>
</apex:page>
**Source: https://gist.github.com/nithesh1992/dc66708bde9ab94313a731a715fef9ad#file-copy-txt

I want to accomplish something like this:
 
<apex:variable ID="copytext" value="TEXT TO BE COPIED" "/>
            
      
        <apex:inputtextarea ID="holdtext" STYLE="display:none;"></apex:inputtextarea>
        <apex:commandbutton onClick="ClipBoard('{!$Component.copytext}', '{!$Component.holdtext}');" rerender="copytext" value="Copy to Clipboard"/>

So that the only visable piece is the button.  Can anyone help me with this?!

Thank you, and happy thanksgiving!
Hello, 

I am trying to write a test class for a VF controller, and I am getting an error saying the variable does not exist even though it does!  Why would this be happening? 

Here is my controller: 
 
public class DailySalesReportController{ 

        public List<Opportunity> listOfCefOpToday {get;set;}
        public List<Opportunity> listOfLoganOpToday {get;set;}
        public List<Lead> listOfCefLdToday {get;set;}
        public List<Lead> listOfLoganLdToday {get;set;}
        public List<Sales_Meetings__c> listOfCefSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfCefOcToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganOcToday {get;set;}
        public Opportunity CefOpToday {get;set;}
        public Opportunity LoganOpToday {get;set;}
        public Lead CefLdToday {get;set;}
        public Lead LoganLdToday {get;set;}
        public Sales_Meetings__c CefSkedToday {get;set;}
        public Sales_Meetings__c LoganSkedToday {get;set;}
        public Sales_Meetings__c CefOcToday {get;set;}
        public Sales_Meetings__c LoganOcToday {get;set;}
    
    public DailySalesReportController(){
        listOfCefOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        
        
}
}

And here is my test: 
 
@isTest(seeAllData = true)
public class DailySalesReportControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your Opportunity record with required field
        //Opportunity b = new Opportunity(Created_Today__c = TRUE);
        //insert b;
        test.startTest();
           DailySalesReportControllerTest ub = new DailySalesReportControllerTest();
           
           if(ub.listOfCefOpToday!=null && !ub.listOfCefOpToday.isEmpty())
           Opportunity cefOpportunity = ub.listOfCefOpToday.get(0);
           
           if(ub.CefOpToday !=null)
            String CefOpTodayId = ub.CefOpToday.Id;
           
        test.stopTest();
    }   
}

I keep getting this error: 
 
Error: Compile Error: Variable does not exist: listofcefoptoday at line 12 column 41

Can anyone help?  I'm really stuck here 
Hello, 

I have an apex class that functions as a VF page controller, and when I run the associated test class it passes - but when I look at the class the coverage is at 0% and it is bringing my code coverage down below 75%.  How can this be?  I would really appreciate some help here!

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   


}
}

and here is my test class: 
 
@isTest(seeAllData =  true)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

I ill be eternally grateful if someone can help me solve this!

Thank you, 

John
Hello, 

I have a controller that is showing 0% code coverage, but I'm not sure why my test class isn't covering anything.  Can anyone help? 

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   
and here is my test: 

}
}
and here is my test? 
 
@isTest(seeAllData = false)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

would anyone be willing to help me beef this up?

it would mean the world to me. 

thank you in advance!!!!!!

John 
 

Hello, 

I am attempting to use inputText on a VF page and can't figure out how to save the value to the record.  Does anyone have an example of this that I could bootstrap off of? 

I am using a custom object & controller. 
 

Here is the string from the VF page: 
 

apex:inputText value="{!spotObj.Workload__c}"/> <apex:commandButton value="Save" action="{!saveSpot}"/>
And here is my controller: 
 
public with sharing class SpotsInProcess{

    public List <Job_Number__c> listOfInProgress {get;set;}
    public Job_Number__c InProgress  {get;set;}

public PageReference saveSpot(){
    UPDATE listOfInProgress;
    return null;
    }


public SpotsInProcess(){
    listOfInProgress = [Select id, name, Workload__c, Notes__c, Thumbnail_URL__c, ISCI__c, Title__c,   First_Air_Date__c,  Last_Air_Date__c, Project__c, Campaign__r.Name, Nets_Running__c, View_Link__c, Internal_Title__c, Legal__c, Airing_Agencies__c from Job_Number__c where Job_Status__c = 'In Progress']; 
}
}

It would mean the world to me if someone could help me out!

Thanks in advance! 
 
Hello, 

I am using apex:outputLink on a vf page to open a new window - but it is refreshing my original page upon click.  Is there a way to stop this?  Here is my link. 
 
<apex:outputLink onclick="window.open('AllSpotsMoreDetails?id={!spotObj.Id}', 'newwindow', 'width=800, height=900')"> More Details</apex:outputLink>

Thanks, 

John

 
Hello, 

I have a VF page that is using apex:repeat to create a table column for each related object record like so:
 
<apex:repeat value="{!Quarterly_Buy__c.Media_Buys__r}" var="buys">
                     <td style="background-color: #D8D8D8; color: #190707;font-size:14px;" align="center">
                        <b>{!MONTH(buys.Broadcast_Week__c)}/{!DAY(buys.Broadcast_Week__c)}/{!VALUE(RIGHT(TEXT(YEAR(buys.Broadcast_Week__c)),2))}</b>
                    </td>

I want to add a condition where a column is only renedered if the field "Broadcast_Week__c" on the child record is greater than Today. 

I have adding a "Display" attribute to the td saying: 
 
display: {!IF(Quarterly_Buy__c.Media_Buys__r.Broadcast_Week__c < Today(), 'none', 'table-column')};"

but I am getting en error. 

Can anyone help? 

Thanks, 

John
Hello, 

I am trying to add UPDATE functionality to a controller and am getting the error: DML requires SObject or SObject list type: List<String>

However my variable is set up like this: public List<String> campaigns {get;set;}

I am not sure how to achieve the proper syntax here, and was hoping that someone out there in developerland would be able to help me!

Here is my (broken) controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> listOfOpty {get;set;}
public List<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE campaigns;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  listOfOpty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : listOfOpty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

Thanks in advance!

John

 
Hello - 

I have a controller with a variable that is output as an array - and I would like to use UPDATE to give my users the ability to make in-line edits to records displayed an a VF page.  Is this at all possible? 

Here is my controller:
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

I am trying to get this statement:  

 
public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

to update these records: 
 
campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ];

But the changes just won't save. 

Is there anything I can do differently to make this work? 

Thanks, 

John
Hello, 

I am trying to make an HTML table inside of a VF page sortable - but I am having some trouble. 

I am using this sample as a template: http://www.kryogenix.org/code/browser/sorttable/

And if I create a dummy page with static, dummy data this works like a charm.  Howeever if I apply this to a VF page that retruns data from a controller it doesn't work. 

When I click on a table header, the alternating "up/down" arrows appear, but the data doesn't budge.  Is there something that I need to add to my controller to make this work?

Here is my page: 
 
<script src="{!URLFOR($Resource.sorttable)}"> </script>
<meta charset="utf-8" />
<title>R2M PIPELINE</title>
<link rel="stylesheet" type="text/css" href="{!URLFOR($Resource.GUIstyle)}" media="all" />
</head>
<body>
    <div id="header">
            <div id="logo">
                <a href="index.html"><img src="{!URLFOR($Resource.Logo)}" alt="" /></a>       
            </div>
<ul>
    <li><a href="apex/GUIHome"><span>Gene</span></a></li>
                <li><a href="/apex/HappeningNow"><span>Happening Now</span></a></li>
                <li><a href="/apex/ClientDelivery"><span>Client Delivery</span></a></li>
                <li><a href="/apex/MediaCash"><span>Media Cash</span></a></li>
                <li><a href="/apex/ROIREVENUE"><span>ROI and Revenue</span></a></li> 
                <li><a href="/apex/PRODUCTION"><span>Production</span></a></li>    
                <li><a href="/apex/SalesActivity"><span>Sales Activity</span></a></li> 
                <li><a href="/apex/PIPerformance"><span>PI Performance</span></a></li>
                <li><a href="https://na2.salesforce.com/"><span>Salesforce Home</span></a></li> 
            </ul>
  </div>
    <div id="body">
        <div class="about">
            <h1>R2M Pipeline</h1>
            <div>
            
           <c:PipelineNav />


 <apex:repeat value="{!campaigns}" var="camp">

    <apex:form >
    <apex:pageBlock title="{!camp}" mode="inlineedit">
        <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1080" border="1" class="sortable" >
                
                <thead>
                <tr>
                              <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Opportunity Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Company Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="80">
                        <b>Contract Sent</b>
                                   
                    
                    </th>
                     <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b>Days Idle</b>
                    </th>
                                 
                    <th style="background-color: #C6D4D4; color: #040404" width="70">
                        <b>Created</b>
                    </th>
        <th style="background-color: #C6D4D4; color: #040404" width="450">
                        <b>Next Step</b>
                    </th>
                  
                    <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b><apex:commandLink reRender="button" onclick="window.open('/apex/Probability_Guide','','width=500,height=300')" id="button">Prob%</apex:commandLink></b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Owner</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Stage</b>
                    </th>
                
                </tr>
                </thead>
                
                 <apex:repeat value="{!Opty}" var="cs"> 
                 
                  <apex:outputPanel rendered="{!IF(camp=cs.Vert_Med__c,true,false)}" >
                  <tbody>
                      <tr>
                                  
                            <td width="100">
                                <a href="https://na2.salesforce.com/{!cs.id}">{!cs.name}</a>
                            </td>  
                              <td width="100">
                                {!cs.Company_Name__c}
                            </td> 
                                <td width="80">
                            
                               <apex:outputField value="{!cs.Contract_SENT__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                          
                           
                            <td width="50">
                                {!cs.Days_Since_Last_Modified__c}
                            </td>
                            <td width="70">
                                 {!MONTH(DATEVALUE(cs.CreatedDate))}/{!DAY(DATEVALUE(cs.CreatedDate))}/{!YEAR(DATEVALUE(cs.CreatedDate))}
                            </td>
                            
                            <td width="450">
                                <apex:outputField value="{!cs.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                           
                             <td width="50">
                                <apex:outputField value="{!cs.Probability}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                            <td width="100">
                                {!cs.Owner_Name__c}
                            </td>
                            <td width="100">
                                {!cs.StageName}
                            </td>
                          
                        </tr>
                     </tbody>
                      </apex:outputPanel>
                     </apex:repeat>
                     </table>
                     
                     <apex:commandButton action="{!saveOp}" value="Update Opptys"/>  
    </apex:pageBlock>
    </apex:form>
            <br/>
  </apex:repeat>
           
                          </div>
            <div>
                    
             </div>
            <div> </div>
        </div>
    </div>
         <div id="footer">
            <div>
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>      
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3></h3>
                    <ul>
                        <li></li>                
                        <li></li>
                    </ul>           
                </div>  
                <div>
                    <h3>Social</h3>
                    <a class="facebook" href="https://www.facebook.com/pages/Ring2Media-INC/845391462194555" target="_blank">R2M Facebook</a>     
                    <a class="twitter" href="https://twitter.com/ring2media" target="_blank">R2M Twitter</a>
                </div>  
            </div>
            <div>
                            </div>
        </div>
        <style>

             .odd {

              background-color: #A4A4A4;

                }

             .even {

             background-color: #E6E6E6;

                }

            </style>
    </body>            
                  


</html>

And here is my controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

Is it possible to achieve what I am trying to accomplish with this method?

Thanks, 

John
Hello, 

I would like to create a hyperlink on one of my VF pages where upon click a new window opens that is 500px X 500px.  This will be for a "Help topic" - but I can not seem to figure out how to force the hyperlink to open in a new window and not a new tab.  

I tried using something like this: 
<b><apex:outputLink onclick="window.open(URL,'/apex/Probability_Guide','width=500,height=500')">Prob%</apex:outputLink></b>

And the new window is opening properly, but the page displayed in the new window is just a repeat of the page where the link resides.  How do I direct the new window to open /apex/Probability_Guide?

Thanks in advance!

John
 
Hello, 

I have inlineedit enabled on a pageBlock, is there a way that I can control the size of the inputtext box that appears when a value is dblclicked?
 
<apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />

I have a Text Area field displayed in this pageBlock, however when a user double-clicks the value the input text box shrinks down to a standard 255 character text field.  Is there a way that I can override that behaivor?

User-added image