• B2000
  • NEWBIE
  • 95 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 63
    Questions
  • 94
    Replies
I am trying to save a renderedAs PDF VF page as an attachment.  Instead of saving the PDF page, it is saving the current page as the attachment.  The current page is: pTestEmail.  The button in the pTestEmail is used to save pTestReport (renderedAs PDF) as an attachment to the account. pTestReport has a component embedded in the VF page (this is a requirement).  The contents of pTestEmail get saved as the attachment: MAIN PAGE (Email Button) and not the pTestReport: PDF COMPONENT
Controller: cTestEmailReport
public with sharing class cTestEmailReport 
{	
   public	Account	a {get;set;}
   public String reportName = ApexPages.currentPage().getParameters().get('reportName');
    
    public cTestEmailReport(ApexPages.StandardController stdCon) 
    {
        this.a = (Account)stdCon.getRecord();       
        a = [Select Id, Name from Account where id = :a.id];        
    }
    
    public pageReference sendEmail()
    {
	PageReference pr = new PageReference('/apex/pTestReport');
    	pr.getParameters().put('id',a.id);
	pr.setRedirect(true);
	system.debug(pr);		
	Attachment att = new Attachment(Name=reportName,Body=pr.getContent(),ParentId=a.id);
	insert att;
 	pr = new PageReference ('/'+a.id);
 	pr.setRedirect(true);
	return pr;		
    }
 
}

VF Page: pTestEmail
<apex:page standardController="Account" extensions="cTestEmailReport">
<apex:form id="form">
MAIN PAGE
<apex:commandbutton value="EMAIL" action="{!sendEmail}" rerender="form"/>
</apex:form>
</apex:page>

VF Page: pTestReport
<apex:page standardController="Account" showHeader="false"  sidebar="false" renderAs="PDF" standardstylesheets="false" applyBodyTag="false">
    <c:compTest />  
</apex:page>

Component: compTest
<apex:component >PDF COMPONENT</apex:component>

 
  • March 18, 2015
  • Like
  • 0
I would like to create a link using the value of get.value() method when the object is an Id.  I have a working solution but wonder if there is another I'm missing.  Here is the code:
This is what I would like:
<apex:repeat value="{!reportResults.factMap['T!T'].rows}" var="row" >
  <tr>
  <apex:repeat value="{!row.dataCells}" var="cell">
    <td>
      <apex:outputText value="{!cell.label}" rendered=“{!IF VALUE NOT AN ID}”/>
      <apex:outputLink value="/{!cell.value}”rendered=“{!IF VALUE IS AN ID}”/>
         {!cell.label
      </apex:outputLink>

The code below works but is there a better solution?

VP Page
<apex:variable value="{!0}" var="cnt"/>
<apex:repeat value="{!reportResults.factMap['T!T'].rows}" var="row" >
  <tr>
  <apex:repeat value="{!row.dataCells}" var="cell">
    <td>
      <apex:outputText value="{!cell.label}" rendered="{!AND(cnt<listIds.size,listIds[cnt]='BLANK')}"/>
      <apex:outputLink value="/{!listIds[cnt]}"
        rendered="{!AND(cnt<listIds.size,listIds[cnt]!='BLANK')}">
        {!cell.label}
      </apex:outputLink>
    </td>
    <apex:variable value="{!cnt+1}" var="cnt"/>

Controller:
for (Reports.ReportDetailRow rd : factDetails.getRows())
{             
  for (Reports.ReportDataCell cd : rd.getDataCells())
  {
     listIds.add('BLANK');
     if (cd.getValue() instanceOf Id)
       listIds[listIds.size()-1] = (String)cd.getValue();    
  }
}
Thanks
  • February 23, 2015
  • Like
  • 0
Is anyone having issues with HTML email templates?  When I try and create an HTML, custom, or Visusalforce email template, the HTML Preview section after saving shows an sad face icon with the message "There were too many redirects." I have even tried with just text and it still has the same result.  I have an existing Visusalforce email template that shows the same message and won't work.  I have the same problem with two different servers: cs1.salesforce.com and na15.salesforce.com.
  • February 21, 2015
  • Like
  • 0
How do I pass a list of strings values (not a controller variable) in the VF Page component tag to the controller?
VF Page: <c:testComponent strList="1,2,3" />
Component: <apex:component controller="testCont"> <apex:attribute name="strList" type="String[]" assignTo="{!listStrings}" required="true" description="" />
testCont Controller: public String[] listStrings {get;set;}
I have tried strList="1,2,3", strList="[1,2,3]", strList="{1,2,3}" and also with single quotes around each element.
I get this VF Page error message: Content cannot be displayed: Cannot convert the value of '{!listStrings}' to the expected type.
Thanks
  • February 21, 2015
  • Like
  • 0
I have a wrapper class with an Integer list.  In the VF page when I try and save, I get Error: Unknown Property 'xxx 'when I try and use an inputText. However, it saves and displays correctly if I use an outputText.  Here is a partial list of the code VF page and class:
<apex:repeat value="{!listWProduct}" var="prd">        
<tr>
  <th style="text-align:center;"><apex:inputcheckbox value="{!prd.isSelected}"/></th>
  <th style="text-align:left;"><apex:outputField value="{!prd.p2.Name}"/></th>
     <apex:repeat value="{!prd.listTerm}" var="xxx">                  
       <td style="text-align:center;">
        <apex:inputText value="{!xxx}"/> get Unknown Property: 'xxx' when trying to save VF page
        <apex:outputText value="{!xxx}"/> this works and VF page saves
       </td>
    </apex:repeat>
</tr>
</apex:repeat>

    public class wProduct implements Comparable
    {
        public Product2            p2             {get;set;}
        public Boolean             isSelected     {get;set;}
        public Integer[]             listTerm       {get;set;}
        
        public wProduct (Product2 p2)
        {
            this.p2      = p2;
            isSelected   = false;
            listTerm     = new Integer[]{0,0,0,0,0,0,0,0,0,0};
        } 
        
        public Integer compareTo(Object other)
        {    
            String otherName = other != null ? ((wProduct)other).p2.Name : ''; 
            return p2.Name.compareTo(otherName); 
        }
    } 

in class:
public  wProduct[]                  listWProduct                                {get;set;} 
listWProduct                        = new wProduct[]{};
for (Product2 p2 : [Select id,Name From Product2]) {
            listWProduct.add(new wProduct(p2));   
        }

 
  • January 13, 2015
  • Like
  • 0
I have a trigger iterating over an Asset object.  There are 3 fields on the Asset object that are needed be exactly the same values that are on a Contract object.  The most recent Contract object's end date (that match these 3 fields) will populate a field on the Asset object.  I can't determine if there is a way to do a query on the Contract object.  The workaround I have done is to create a formula field on the Contract object that concatenates the 3 fields; then I create a list of the 3 concatenated Asset fields; finally I query the Contract object's formula field using the list of concatenated fields.  Is there another solution without this workaround?
Thanks

  • April 12, 2014
  • Like
  • 0
I have an inner class that has a method I want to call using a Map.  I get the following error when trying to save the VF Page.  The CommandLink line of code is causing the error.

Error Error: java.lang.UnsupportedOperationException
Error Error: null

Here is the code:
public with sharing class TestInnerClass
{
  class wA
  {
 
public  Account         a    {get;set;}
public wA(Account a){this.a = a;}
public void saveAcc(){upsert a;}
 
  }
  public Map<String,wA> mapWAcc {get;set;}

  public TestOuterClass()
  {
  mapWAcc  = new Map<String,wA>(); 
  mapWAcc.put('Test',new wA(new Account(Name='Test')));
  }
}

<apex:page controller="TestOuterClass">
<apex:form >
    <apex:repeat value="{!mapWAcc}" var="idMap">
    <apex:repeat value="{!mapWAcc[idMap]}" var="wAcc">
        <apex:inputField value="{!wAcc.a.Name}"/>
        <apex:commandLink value="Save" action="{!wAcc.saveAcc}"/>
    </apex:repeat>
    </apex:repeat>
</apex:form>
</apex:page>

Thanks
  • February 24, 2014
  • Like
  • 0

I am trying to use a StandardSetController with a sorted List View.  Instantiating the StandardSetController using a List of objects provides a different set of records than instantiating using a query locator when followed by using the 

setFilterID method.  I've tried sorting using the inital query and also sorting using a column in the List View. 

 

Case 1: Query Locator.  

  A. Records from query locator are sorted correctly after the query.

  B. Records are resorted after setting the setFilterId by the Name field and not by either the initial query nor by the sorted field selected on the List View (I've tried several different columns on the List View and moving the columns to the first item too)

  C. Changing the picklist listViewOptions value, filterId, correctly changes the records returned in step B from the correct List View.  But again the records are not sorted correctly by either the query in step A nor the sorted field selected in the List View.

 

Case 2: List of Objects:

  A. Records from query locator are sorted correctly after the query.

  B. Records remain sorted correctly after setting the setFilterId.  

  C. Changing the picklist listViewOptions value, filterId, does not change the records returned in step B. It appears in step B the setFilterId is not being applied. So the records are from the orginal query and the List View filters is not being applied.

 

    public ApexPages.StandardSetController setCon 
    {
        get
        {
            if(setCon == null)
            {
            	Affiliate_Order__c[] qryList = [SELECT Name, createdDate
                	FROM Affiliate_Order__c order by createdDate DESC Limit 10000];
                size = 20;
                string queryString 	= 'SELECT Name, createdDate FROM Affiliate_Order__c order by createdDate DESC Limit 10000';
				setCon = new ApexPages.StandardSetController(qryList);               
                //setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
                for (Affiliate_Order__c ao :(List<Affiliate_Order__c>)setCon.getRecords())
                	system.debug('\n\n@@@ao[PRE]='+ao);
                	
				setCon.setPageSize(size);				
                listViewOptions 	= setCon.getListViewOptions();                        		
        		setCon.setFilterID(listViewOptions[0].getValue());
        		if (filterId != null)
        			setCon.setFilterID(filterId);        		
                noOfRecords 		= setCon.getResultSize();
                system.debug('\n\ngetFilterId='+setCon.getFilterId());
                for (Affiliate_Order__c ao :(List<Affiliate_Order__c>)setCon.getRecords())
                	system.debug('\n\n@@@ao[POST]='+ao);
                
        		
            }
            return setCon;
        }
        set;
    }
     
    public List<Affiliate_Order__c> AOList
    {
    	get 
    	{
    		
	        Affiliate_Order__c[] AOList 	= new Affiliate_Order__c[]{};
	        for (Affiliate_Order__c ao :(List<Affiliate_Order__c>)setCon.getRecords())
	        {
	        	AOList.add(ao);
	        }

	        return AOList;
    	}
    	set;
    }
     
    public pageReference refresh() 
    {
        setCon 						= null;
        setCon.setPageNumber(1); 
        return null;
    }
    public void refreshList(){}


<apex:page controller="AffiliateOrderTabExt" sidebar="false">
    <apex:form >
        <apex:pageBlock id="pb" title="Orders">
            
            <apex:pageMessages />
            <apex:actionFunction name="refresh" action="{!refresh}" reRender="pb"/>
            <apex:pageBlockButtons location="top">
                    <apex:outputLabel value="View:" style="font-weight:bold;"/>&nbsp;&nbsp;
                    <apex:selectList value="{!filterId}" size="1">
                        <apex:actionSupport event="onchange" action="{!refresh}" reRender="pb" />
                        <apex:selectOptions value="{!listViewOptions}"/>
                    </apex:selectList>   
            </apex:pageBlockButtons>
            
            <apex:pageBlockTable value="{!AOList}" var="ao" id="aoTable">

                <apex:column headerValue="Order">
                    <apex:outputLink value="{!URLFOR($Page.AffiliateOrderViewPage,null,['aoId'=ao.id])}">{!ao.Name}</apex:outputLink>
                </apex:column>
                <apex:column headerValue="Created">
                    <apex:outputText value="{0,Date,M/d/yyyy}" >
                        <apex:param value="{!ao.createdDate}"/> 
                    </apex:outputText>        
                </apex:column>    
            </apex:pageBlockTable>
                                                           
            <apex:panelGrid columns="7">
                <apex:commandButton status="fetchStatus" reRender="pb" value="<<" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value="<" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value=">" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value=">>" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
                <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
                <apex:commandButton status="fetchStatus" reRender="pb" value="Refresh" action="{!refreshList}" title="Refresh Page"/>
                <apex:outputPanel style="color:#4AA02C;font-weight:bold">
                    <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>
                </apex:outputPanel>
            </apex:panelGrid>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

  • September 18, 2013
  • Like
  • 0

I ran all the Apex Unit Tests and 5 CMSForce classes are failing.  They all come from the trigger checkObjectAPIName with the error "The Object API name is not correct."  I believe it is not the code itself but some data in the system causing the problem.  However, I'm not sure how to research "this happens when the object's API name doesn't exist, or has been removed from the profile access settingsTypically when admin's don't setup the webform editor correctly"

Thanks

 

trigger checkObjectAPIName on Web_Form__c (before insert, before update) {

  //Map that holds all the object names and tokens in your org
  Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();

  for(Web_Form__c form:Trigger.New) {
        //just for other tests, provide a bypass to this one
        if(form.Object_Name__c.contains('testbypassx')) continue;
        //get a reference to the token related to the object referenced in the webform
        SObjectType sot = gd.get(form.Object_Name__c);
        //instantiate an object of this type
        try {
          SObject sobjectInstance = sot.newSObject();
        }
        //this happens when the object's API name doesn't exist, or has been removed from the profile access settings
        //Typically when admin's don't setup the webform editor correctly
        catch(System.NullPointerException ex) {
          form.addError('The Object API name is not correct.');          
        }

 

 

  • November 14, 2012
  • Like
  • 0

I am trying to use JQuery to display some text when some other text is moused over but it is not working.  Here is my current code.  Thanks.

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
  j$('[id$=hideshow]').mouseover(function(){
    j$('[id$=description]').show();
  });
  j$('[id$=hideshow]').mouseout(function(){
    j$('[id$=description]').hide();
  });
});
</script>

TABLE
<td style="text-align:left;vertical-align:middle;">
<apex:outputText value="{!wISL.ms.Name}" id="hideshow" /> 
<apex:outputText value=" {!wISL.ms.Service_Description__c}" id="description"/>
</td>   

 

  • September 27, 2012
  • Like
  • 0

I have a commandLink that adds a new item to the bottom of the table.  When I reRender the table, it refreshes to the top and I would like to set the focus to the first field on the new item.  I tried using the actionFunction in conjunction with a javascipt to set the focus but no luck as I'm unsure how to provide the last item's id to the actionFunction. I was successful in creating an inputfield below the table with the "bottom" id and set the actionFunction focus there but it is a workaround.  I appreciate any assistance.

 

    <apex:form id="PCOForm">               
    <div class="header" id="header">  
        <div class="leftcol">...</div><!-- END leftCol --> 
         <apex:outputPanel id="templatePanel" >…</apex:outputPanel>   
    </div><!-- END header -->    

    <div class="mainContent" id="mainContent">    
    <apex:outputPanel id="PCOPanel">        
        <div class="singleCol" id="singleCol">       
        <div class="titleBar">…</div><!-- END titleBar -->      
        <div class="content" id="content">
        <div class="scrollContentView" id="scrollContentView">
        <apex:actionFunction name="resetFocus"  focus="theFocus" reRender="PCOForm"/>
               
        <apex:variable var="row1Color" value="#f1f1f1"/>
        <apex:variable var="row2Color" value="#FFFFFF"/>
        <apex:variable var="row3Color" value="#8CB6D7"/>
        <apex:variable var="btblue" value="#21449c"/>

        <apex:outputPanel id="PCOTblPanel">        
        
        <table cellpadding="0" cellspacing="0" class="list"  border="0" id="PCOTbl">
            <tr id="TblHdr1">...</tr>
        
            <apex:variable var="cntRow" value="{!0}"/>
            <apex:repeat value="{!wPChangeOrderList}" var="PCO">
            <apex:variable var="cntRow" value="{!cntRow+1}"/>
            
            <tr id="TblRow1">                    
                <td style="width:1%;">.../td>      
                <td style="text-align:left;width:19%;" id="TblRow1Col2">
                    <b>
                    <apex:inputField styleClass="inputText" value="{!PCO.PChangeOrder.Name}" rendered="{!IF(pageType!='View',true,false)}" id="TblRow1Col2Name"/>
                    <script> var theFocus = document.getElementById(“{!$Component.TblRow1Col2Name}”); </script>
                    <apex:outputField value="{!PCO.PChangeOrder.Name}" rendered="{!IF(pageType='View',true,false)}"/>
                    </b>
                    <apex:outputText value="{!PCO.errorMsg}" style="color:red;text-weight:bold;" rendered="{!IF(ISNULL(errorMsg),false,true)}"/>                     
                </td>
…..
        </table>
        <apex:inputText id="bottom" style="width:0px;height:1px;"/>
…..                
        <apex:commandLink value="New Item" action="{!newChangeOrderItem}" styleClass="new" rendered="{!IF(isChangeOrderItemSelected,true,false)}" 
                    oncomplete="resetFocus();"  >
                    <apex:param assignTo="{!PropertyChangeOrderId}" value="{!PropertyChangeOrderId}" name="PropertyChangeOrderId"/>                                        
                    <apex:param assignTo="{!rowIdx}" value="{!rowIdx}" name="rowIdx"/>  
                    <apex:param value="Edit" assignTo="{!pageType}" name="pageType"/> 
                </apex:commandLink> 

 

 

 

  • June 15, 2012
  • Like
  • 0

I have a problem with IE.  The VF page works correctly in Chrome, Firefox, and Safari but not IE9 (only tested in IE9).  I have an inputCheckbox that when clicked, an actionSupport executes a wrapper class method that sets and updates a date based on if it is checked or unchecked.  Each time the checkbox is checked/unchecked in the 3 browsers, the date and checkbox are populated correctly.  However, in IE9, the first two times the checkbox is checked/unchecked, the checkbox and date populate correctly.  The third time checking/unchecking/checking the checkbox, neither the checkbox nor the date populate and none of the other checkboxes in the list work.  I even tried it with a SelectList and the same thing happens.

Thanks for any assistance.

 

<apex:page controller="PropertyEdit" id="PViewPage" docType="xhtml-1.0-transitional" showHeader="false" >
<apex:form id="PropertyEditFormTop">
<apex:actionFunction name="refreshPage" action="{!refreshPropertyTaskList}" reRender="PropertyEditForm"/>
<apex:actionFunction name="refreshPropertyTaskList" action="{!refreshPropertyTaskList}" reRender="PropertyEditForm"/>
<apex:actionFunction name="refresh" action="{!refresh}" reRender="PropertyEditForm"/>
<apex:composition template="bt_template2">
               
    <apex:define name="body">
    <apex:outputPanel id="PropertyEditForm">
        <div class="sidebar">
            <div class="titleBar">                        
                <h2>Property Information                  
                   <apex:outputLink styleclass="sideBarEdit" value="{!$Page.PropertyEdit}">
                       Edit
                       <apex:param name="PropertyId" value="{!propertyId}" /> 
                       <apex:param name="PageType" value="Edit" /> 
                    </apex:outputLink>
                </h2>
            </div> <!-- END titleBar -->

            <div class="content">
                <h3>Property Address</h3>
                    <p>&nbsp;<strong>{!PropertySelected.Property_Address__c}<br />
                    &nbsp;{!PropertySelected.Property_City__c & ', ' & PropertySelected.Property_State__c &' '& PropertySelected.Property_Zip__c}</strong></p>
                <br />
                <h3>Property Details</h3> 
                <table>
                    <tr>
                        <td>Lot #:</td>
                        <td><strong>{!PropertySelected.Lot_Number__c}</strong></td>
                    </tr>                
                    <tr>
                        <td>Subdivision:</td>
                        <td><strong>{!PropertySelected.Subdivision__c}</strong></td>
                    </tr>   
                    <tr>
                        <td>Close Date:</td>
                        <td>
                            <em>
                            <strong>
                            <apex:outputText value="{0,Date,MM/d/yyyy}">
                                <apex:param value="{!PropertySelected.Proposed_Closing_Date__c}"/>
                            </apex:outputText>
                            </strong>
                            </em>
                        </td>                                   
                    </tr>
                    <tr>
                        <td>Contract Amount:</td>
                        <td><strong>
                            <apex:outputText value="{0,number,$###,###,###}">
                                <apex:param value="{!PropertySelected.Contract_Amount__c}"/>
                            </apex:outputText>                    
                        </strong></td>                
                    </tr>                
                    <tr>
                        <td>Permit Number:</td>
                        <td><strong>{!PropertySelected.Permit_Number__c}</strong></td>                
                    </tr>                                                      
                </table>   
                <br />
                <h3>Buyer Information</h3>
                <br />
                <strong>{!ContactFromPropertySelected.FirstName} {!ContactFromPropertySelected.LastName}</strong>
                    &nbsp;{!ContactFromPropertySelected.Phone}<br />
                    &nbsp;{!ContactFromPropertySelected.MailingStreet}<br />
                    &nbsp;{!ContactFromPropertySelected.MailingCity & ', ' & ContactFromPropertySelected.MailingState &' '& ContactFromPropertySelected.MailingPostalCode}
            
            </div><!-- END content -->
            
            
            <div class="titleBar">
                <h2>
                    Property Costs<a class="sideBarEdit" href="{!URLFOR($Page.PropertyCostItemEdit,null,['PropertyId'=propertyId,'PageType'='View'])}">Edit</a>
                </h2>
            </div>
            <div class="content">
            <table>
            
                <tr>
                    <td valign="top">Actual Expense:</td>
                    <td valign="top" align="right"><strong>
                        <apex:outputText value="{0,number,$###,###.00}">
                            <apex:param value="{!totalCostList[0]}"/>
                        </apex:outputText>
                    </strong></td>                
               </tr>
                <tr>
                    <td valign="top">Original Budget:</td>
                    <td valign="top" align="right"><strong>
                        <apex:outputText value="{0,number,$###,###.00}">
                            <apex:param value="{!totalCostList[1]}"/>
                        </apex:outputText>
                    </strong></td>
                </tr>
                <tr>
                    <td valign="top">Revised Budget:</td>
                    <td valign="top" align="right"><strong>
                        <apex:outputText value="{0,number,$###,###.00}">
                            <apex:param value="{!totalCostList[2]}"/>
                        </apex:outputText>
                    </strong></td>                
                </tr>
                <tr>
                    <td valign="top">Variance:</td>
                    <td valign="top" align="right"><strong>
                        <apex:outputText value="{0,number,$###,###.00}" rendered="{!IF(totalCostList[3]>=0,true,false)}">
                            <apex:param value="{!totalCostList[3]}"/>
                        </apex:outputText>
                        <apex:outputText value="{0,number,($###,###.00)}" style="color:red;" rendered="{!IF(totalCostList[3]<0,true,false)}">
                            <apex:param value="{!ABS(totalCostList[3])}"/>
                        </apex:outputText>
                    </strong></td>                
               </tr>
            </table>
            </div><!-- END content -->       
            </div><!-- END sidebar -->
            
            <div class="doubleCol">         
            <div class="titleBar">
                <h2>
                    Property Task -&nbsp; 
                    <apex:selectList value="{!selectedPropertyTaskStatus}" size="1" 
                        onchange="refresh();" >
                        <apex:selectOptions value="{!propertyTaskStatusOptionList}"/>
                    </apex:selectList>                                       
                </h2>
            </div><!-- END titleBar -->
            
            <div class="content">
            <div class="scrollContentView">
            
            <apex:variable var="row1Color" value="lightgray"/>
            <apex:variable var="row2Color" value="#FFFFFF"/>
            <apex:outputPanel id="PropertyTaskTable">
            <table cellpadding="0" cellspacing="0" class="list" border="1">
                <tr>
                    <th class="cellTwo nowrap">▲</th>
                    <th class="cellTwo nowrap">▼</th>                    
                    <th class="cellTwo">Comp?</th>
                    <th class="cellFour">Description</th>
                   <!-- <th class="cellThree center nowrap">Forecasted<br />Start Date</th>
                    <th class="cellThree center nowrap">Forecasted<br />End Date</th>-->
                    <th class="cellThree center nowrap">Scheduled<br />Start Date</th>
                    <th class="cellThree center nowrap">Scheduled<br />End Date</th>
                    <th class="cellThree center nowrap">Actual<br />Start Date</th>
                    <th class="cellThree center nowrap">Actual<br />End Date</th>
                    <th class="cellFour">Project Manager</th>
                    <th class="cellFour">Vendor</th>
                    <th class="cellTwo center">Dur</th>
                    <th class="cellTwo center">Dep</th>
                    <th class="cellTwo">Delete?</th>
                </tr>
                
                <apex:variable var="cntRow" value="{!0}"/>
                <apex:repeat value="{!wPTaskItemList}" var="PT">
                <apex:variable var="cntRow" value="{!cntRow+1}"/>
                
                <tr style="background-color:{!IF(MOD(cntRow,2)=0,row1Color,row2Color)};
                    {!IF(OR(AND(selectedPropertyTaskStatus!='All',selectedPropertyTaskStatus!=PT.PTaskItem.Status__c),PT.isDeleted),'display:none;','')}">
                    <td class="cellTwo nowrap">
                        <apex:commandLink action="{!adjustPropertyTaskItemList}" style="text-decoration:none;"    
                        value="{!IF(cntRow!=1,'▲','')}">  
                            <apex:param assignTo="{!adjustIdx}" value="-{!PT.PTaskItem.Order__c}" name="adjustIdx"/>                
                        </apex:commandLink>                          
                    </td>
                    
                    
                    <td class="cellTwo nowrap">
                        <apex:commandLink action="{!adjustPropertyTaskItemList}"  style="text-decoration:none;"   
                        value="{!IF(cntRow=wPTaskItemList.size,'','▼')}">  
                            <apex:param assignTo="{!adjustIdx}" value="{!PT.PTaskItem.Order__c}" name="adjustIdx"/>                
                        </apex:commandLink>                                                
                    </td>  
                                                            
                    <td >
<!--
                        <apex:selectList value="{!PT.isCompleted}">
                            <apex:actionSupport event="onclick" action="{!PT.toggleCompleted}" reRender="PropertyTaskTable">
                            </apex:actionSupport>
                            <apex:selectOption itemValue="Yes" itemLabel="Yes"/>
                            <apex:selectOption itemValue="No" itemLabel="No"/>
                        </apex:selectList>
-->                        
                         
                        <apex:inputCheckbox value="{!PT.isCompleted}" rendered="{!!ISNULL(PT.PTaskItem.Actual_Start_Date__c)}" >                            
                            <apex:actionSupport event="onclick" action="{!PT.toggleCompleted}" reRender="PropertyTaskTable" >
                                <apex:param assignTo="{!PT.isCompleted}" value="{!PT.isCompleted}" />
                            </apex:actionSupport>
                        </apex:inputCheckbox>     

                    </td>

                                
                    <td class="cellFour nowrap">
                        <apex:outputLink styleClass="new iframe" value="{!$Page.PropertyTaskItemEdit}"> 
                            {!PT.PTaskItem.Name}
                            <apex:param name="PropertyId" value="{!propertyId}" /> 
                            <apex:param name="PageType" value="Edit" />
                            <apex:param name="propertyTaskItemId" value="{!PT.PTaskItem.Id}" />                
                        </apex:outputLink>                      
                    
                    </td>
                    <td class="cellThree center"><apex:outputField value="{!PT.PTaskItem.Scheduled_Start_Date__c}"/></td>
                    <td class="cellThree center"><apex:outputField value="{!PT.PTaskItem.Scheduled_End_Date__c}"/></td>
                    <td class="cellThree center"><apex:outputField value="{!PT.PTaskItem.Actual_Start_Date__c}"/></td>
                    <td class="cellThree center"><apex:outputField value="{!PT.PTaskItem.Actual_End_Date__c}"/></td>            
                    <td class="cellFour nowrap"><apex:outputField value="{!PT.PTaskItem.Project_Manager__c}"/></td>
                    <td class="cellFour nowrap"><apex:outputField value="{!PT.PTaskItem.Vendor__c}"/></td>
                    <td class="cellTwo center">
                        <apex:outputText value="{0,Number,###}">
                            <apex:param value="{!PT.PTaskItem.Duration__c}"/>
                        </apex:outputText>
                    </td>
                    <td class="cellTwo center nowrap"><apex:outputField value="{!PT.PTaskItem.Dependency__c}"/></td>                     
                    <td class="cellTwo center">
                        <apex:commandLink styleClass="delete" value="X" action="{!deletePropertyTask}">
                            <apex:param value="true" assignTo="{!PT.isDeleted}" name="pp"/>
                        </apex:commandLink>                     
                    </td>
                    
                </tr>                
                </apex:repeat>

                
            </table>
            </apex:outputPanel>    
                    
            </div><!-- END scrollContent -->
            <p>     
            <span class="save">                            
                    <apex:outputLink styleClass="new iframe" value="{!$Page.PropertyTaskItemEdit}"> 
                        New Task
                        <apex:param name="PropertyId" value="{!propertyId}" /> 
                        <apex:param name="PageType" value="New" />
                        <apex:param name="orderNumber" value="{!wpTaskItemList.size+1}" />                
                    </apex:outputLink> 
                    <apex:outputLink styleClass="new" value="{!$Page.PropertyTaskItemView}">
                        Edit Tasks
                        <apex:param name="PropertyId" value="{!propertyId}" /> 
                        <apex:param name="PageType" value="Edit" />               
                    </apex:outputLink>  
                    <apex:outputLink styleClass="new" value="{!$Page.PropertyView}"> 
                        Save
                        <apex:param name="PropertyId" value="{!propertyId}" /> 
                        <apex:param name="PageType" value="View" />               
                    </apex:outputLink>                                                       
            </span></p>            
            </div><!-- END content -->           
            </div><!-- END doubleCol2 -->
            
            <div class="clear"><hr class="hide" /></div>
    </apex:outputPanel>            
    </apex:define>
</apex:composition>
</apex:form>
</apex:page>

CLASS
 	public class wPTaskItem
	{
		public Property_Task_Items__c 		PTaskItem				{get{bt.db('get','ptask',PtaskItem);return PTaskItem;}set{bt.db('set','ptask',PtaskItem);this.PTaskItem=value;}}
		public Boolean						isDeleted				{get;set;}
		public Boolean						isExpanded				{get;set;}
		public Boolean						isDisplayed				{get;set;}
		public Boolean						isCompleted				{get;set;}
		public String						selectedCategory		{get;set;}
		public String						selectedProjectManager	{get;set;}
		public String						selectedVendor			{get;set;}
		public String						selectedDependency		{get;set;}
		public String						selectedFollows			{get;set;}
		
		public List<selectOption>			vendorOptionList		{get;set;}
		public List<selectOption>			dependencyOptionList	{get;set;}
		public List<selectOption>			followsOptionList		{get;set;}
		
		public wPTaskItem(Property_Task_Items__c PTaskItem)
		{
			this.PTaskItem			= PTaskItem;
			isDeleted				= false;
			isExpanded				= false;
			isDisplayed				= true;
			if (PTaskItem.Actual_End_Date__c != null)
				isCompleted			= true;
			else
				isCompleted			= false;

			if (PTaskItem.Category__c != null) selectedCategory					= PTaskItem.Category__c;
			else selectedCategory			= 'None';
			
			if (PTaskItem.Project_Manager__c != null) selectedProjectManager	= PTaskItem.Project_Manager__c;
			else selectedProjectManager		= 'None';
			
			if (PTaskItem.Vendor__c != null) selectedVendor						= PTaskItem.Vendor__c;
			else selectedVendor				= 'None';

			if (PTaskItem.Dependency__c != null) selectedDependency				= PTaskItem.Dependency__c;
			else selectedDependency			= 'None';
		}
		
		public void toggleCompleted()
		{
			PTaskItem.Actual_End_Date__c = null; 
			if (isCompleted)
				PTaskItem.Actual_End_Date__c = date.today();
			update PTaskItem;
		}
		public void toggleIsExpanded(){isExpanded = !isExpanded;}
		public void toggleIsDisplayed(){isDisplayed = !isDisplayed;}
					
	} 

 

  • May 02, 2012
  • Like
  • 0

I have a wrapper class with a getter/setter string, a selectOptions list, and a method to be executed after the getter string is populated. I can't get the string setter to work with a selectList when I have a list of the wrapper.  If I use a single wrapper element the code works fine. I have tried using a PARAM statement without success. I would appreciate any assistance.  Thank you.

 

 

public with sharing class tClass
{
List <wClass> wClassList {get;set;}
wClass testWClass {get;set;}
string leftSelected {get;set;}

 public tClass() { testWClass = new wClass(new Account(name="Test Account 0')); wClassList = new List<wClass>(); wClassList.add(new Account(name='Test Account 1)); wClassList.add(new Account(name='Test Account 2')); } public class wClass { public Account a {get;set;} public string leftSelected {get;set;} public list<selectOption> leftSelectOptionList {get;set;} public wClass(Account a){this.a = a; ….code to build leftSelectOptionList} public pageReference selectClick(){String s = leftSelected; LEFTSELECTED IS SET TO NULL WHEN I CHECK WITH DEBUG STATEMENTS WHEN THERE ARE A LIST OF WRAPPER ELEMENTS} } } VF Page <apex:repeat value="{!wClassList}" var="PCOI"> <apex:selectList styleClass="inputText" value="{!PCOI.leftSelected}" size="3"> <apex:actionSupport event="onclick" action="{!PCOI.selectClick}" reRender="Form"> <!-- <apex:param assignTo="{!PCOI.leftSelected}" value="{!leftSelected}" name="left"/> --> </apex:actionSupport> <apex:selectOptions value="{!PCOI.leftSelectOptionList}"/> </apex:selectList> <apex:repeat >

VF PAGE WORKS FINE IF I REMOVE THE REPEAT AND USE testWClass.

 

 

  • April 27, 2012
  • Like
  • 0

I would like to know what is the better design for the database.  The application uses Visual Force pages to perform CRUD methods on a custom object and at least 8 related list objects.  Each record of the custom object has about 5-50 records in each of the related lists.  A majority of the time only a single custom object record and its related lists is queried.

 

1. Is it be better to create a single related list object with a field that specifies the related list type in lieu of the 8 related list objects?  In this case all the fields on each of the 8 related lists objects would be put in the single object.  However, many of these fields obviously would be null. 

 

2. Is there a performance difference between doing 8 queries and 1 query where the same number of records are returned in both cases?  In the case of the single query, the records would be filtered thru code to put them into appropriate lists and is the 8 query method more efficient?

 

3. Is there a performance difference when a query when 10 fields are returned in a query versus 100 fields are returned in a query?  The 100 field query would be filtered thru code to put them into appropriate lists.

 

4. Is there a storage taken up by fields that are null in an object?

 

Thanks

 

 

 

  • March 12, 2012
  • Like
  • 0

I am trying to get a list of child records thru a single relationship query. I can do it with multiple queries, but want to know if I can do it with a single query.  I want all child records from a set of parent ids where the parent id in a set of child Ids. Here is the query I tried but get an error in Eclipse "Malformed Query" row 1, col 116; unexpected token: ,

 

Select f.Family__c, f.Family_Role__c, f.Family_Member__c From Family_Member__c f where f.Family__c in (Select fam.Id, (Select fm.Family__c From Family_Members__r where fm.Family__c in :setOfFamily_Member__cIds) From Family__c fam)

  • February 24, 2012
  • Like
  • 0

The debug log is skipping a large portion of the execution and therefore I can't debug successfully.  I have all filters but APEX Code to None, but still get the message below.  Is there a way to capture the entire debug log?

 

 

*** Skipped 5969061 bytes of detailed log
  • December 07, 2011
  • Like
  • 0

My goal is to have a section on my page to collect and save an attachment to a custom object and also list all the attachments.  

 

The main page has many reRenders which resulted in an error message stating: apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete.  I've read all the current posts on this board and saw two options: 1) create a hidden iframe (was not sure how to do this) 2. Create a popup window.  I used some code posted on the board to create a popup window that uses the inputfile and two buttons, one to save the file and the second to refresh the parent window and close the popup.  The code appears to work fine, but, on the main page when I click on any button (SAVE that does a reRender) below the pageblock section that opens the popup window, the entire page below the popup window pageblock disappears.  I moved the attachment pageblock to the bottom of the page and everything displays correctly.  Any ideas on why the pageblock sections below the popup window section disappear?  Thanks.

 

MAIN PAGE

        <apex:actionFunction name="refreshAttList" reRender="attList"/>

        <!-- SEVERAL pageBlocks here -->

        <apex:pageblock rendered="{!AND(terFlag,NOT(hideTerPlanFlag),displaySection=null,
            territoryPlan!='new',territoryPlan!='none',territoryPlan!=null)}" id="TPAttch" >
            <table>
                <tr>
                    <td>
                        <apex:outputText value="Attachments" />
                    </td>
                    <td>
                        <apex:commandButton value="Save" action="{!saveTPButton}"  
                            rendered="{!AND(isOwner,newTerPlan.Status__c!='Submitted')}"
                            reRender="TPAttch"  style="color:#1797C0;" status="TPAttchStatus"/>

                       <apex:commandButton onclick="window.open('/apex/ATPAddAttachmentPage?id={!territoryPlan}','Add Attachment', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=500,height=100,left = 480,top = 300');"  
                            value="Add Attachment"   
                            rendered="{!IF(AND(isOwner,newTerPlan.Status__c!='Submitted', territoryPlan!='new'),true,false)}"
                            style="color:#1797C0;" />
                    </td> 
                    <td>
                        <apex:actionStatus startText=" (Saving......)" startStyle="color:{!secHdrColor};font-weight:bold;" 
                            id="TPAttchStatus"/>
                        <apex:actionStatus startText=" (Updating……)" startStyle="color:{!secHdrColor};font-weight:bold;" 
                            id="TPAttchUpdateStatus"/>
                    </td>
                </tr>
            </table>

            <apex:pageBlockSection title="Attachment List" id="attList">
            <!-- TABLE OF ATTACHMENTS HERE -->
            </apex:pageBlockSection >
        </apex:pageblock>

        <!-- MANY pageBlocks here that disappear-->

POPUP PAGE
<apex:page controller="ATPAddAttachment" title="Add Attachment" showHeader="false">

<apex:form title="Add Attachment" >
    <h1>Add Attachment</h1>
    <apex:pageBlock >
        <apex:inputFile value="{!attch.Body}" fileName="{!attch.Name}" />
        <br/>
        <apex:commandButton action="{!saveAttachmentButton}" value="Save" rendered="{!!attchFlag}"/>
        <apex:commandButton value="Return" onclick="window.opener.refreshAttList();window.close();" rendered="{!attchFlag}"/>
    </apex:pageBlock>          
</apex:form>
</apex:page>

POPUP CLASS
public with sharing class ATPAddAttachment 
{
  Public Attachment attch          {get;set;}
  public Boolean attchFlag        {get;set;}  
  public ATPAddAttachment()
  {
    attch   = new Attachment(ParentId  = ApexPages.currentPage().getParameters().get('id'));
    attchFlag  = false;
  }    
  public void saveAttachmentButton()
  {
    try
    {insert attch;}
    catch (system.Dmlexception e){}
    finally{attch.Body=null;}    
    attchFlag = true;
  }
}

 

  • November 23, 2011
  • Like
  • 0

I am trying to emulate the Field-Level Help in an HTML table. I don't want to use the PageBlockSectionItem method.  I am using a JavaScript example someone posted here which creates a popup window.  The onmouseover event successfully creates a new window, but the onmouseout event does not close it.  Any suggestions.  Thanks

 

<table>
<tr>                    
<td width="20%" style="font-weight:bold;">Account
<apex:image value="/s.gif" styleClass="helpOrb" title="" onmouseover="openWin('{!$ObjectType.ATP_Account_Plan__c.fields.Account__c.inlineHelpText}');" onmouseout="closeWin();"/>    
</td>
<td><apex:inputField value="{!newAccPlan.Account__c}"/></td>
</tr>
</table>

<script>
    var newWin;
 function openWin(item)
 {
    newWin=window.open('', 'Help','height=200,width=800,left=200,top=100');
    newWin.document.write(item);
    newWin.focus();
 } 
 function closeWin() {newWin.close();}
 </script>   

 

  • November 10, 2011
  • Like
  • 0

I would like to either 1. Not display or remove the datepicker input link (the link after the input field) 2.Make the datepicker input link  display below the input field in a table i.e. a double row height. The datepicker input widget takes up alot of space in the table and I want a narrow column with just the input field, not the link or the link below the input field.  I currently use an HTML <table><tr><td><apex:inputField value="{!date}/> format.  I tried using style=”word-wrap: break-word” in <td> and <apex:inputField> with no luck.  I don't know if you can and how to do it, to modify the datepicker class to put the style in an HTML head section. I was able to shrink the <td> usning colwidth, but either the link overflows into the next <td> section or you can still see the "[", brace, that overflows slightly into the next <td> column. Thanks.

 

  • November 03, 2011
  • Like
  • 0

I need to query all opportunities for a user and their subordinates in the UserRole heirarchy.    I currently create a set of UserRole Ids from all the UserRole records to do the query.  I wasn't sure if their is another way to accomplish this. Any recommendations?

Thanks.

 

  • September 21, 2011
  • Like
  • 0
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 
Is anyone having issues with HTML email templates?  When I try and create an HTML, custom, or Visusalforce email template, the HTML Preview section after saving shows an sad face icon with the message "There were too many redirects." I have even tried with just text and it still has the same result.  I have an existing Visusalforce email template that shows the same message and won't work.  I have the same problem with two different servers: cs1.salesforce.com and na15.salesforce.com.
  • February 21, 2015
  • Like
  • 0
How do I pass a list of strings values (not a controller variable) in the VF Page component tag to the controller?
VF Page: <c:testComponent strList="1,2,3" />
Component: <apex:component controller="testCont"> <apex:attribute name="strList" type="String[]" assignTo="{!listStrings}" required="true" description="" />
testCont Controller: public String[] listStrings {get;set;}
I have tried strList="1,2,3", strList="[1,2,3]", strList="{1,2,3}" and also with single quotes around each element.
I get this VF Page error message: Content cannot be displayed: Cannot convert the value of '{!listStrings}' to the expected type.
Thanks
  • February 21, 2015
  • Like
  • 0
I have a wrapper class with an Integer list.  In the VF page when I try and save, I get Error: Unknown Property 'xxx 'when I try and use an inputText. However, it saves and displays correctly if I use an outputText.  Here is a partial list of the code VF page and class:
<apex:repeat value="{!listWProduct}" var="prd">        
<tr>
  <th style="text-align:center;"><apex:inputcheckbox value="{!prd.isSelected}"/></th>
  <th style="text-align:left;"><apex:outputField value="{!prd.p2.Name}"/></th>
     <apex:repeat value="{!prd.listTerm}" var="xxx">                  
       <td style="text-align:center;">
        <apex:inputText value="{!xxx}"/> get Unknown Property: 'xxx' when trying to save VF page
        <apex:outputText value="{!xxx}"/> this works and VF page saves
       </td>
    </apex:repeat>
</tr>
</apex:repeat>

    public class wProduct implements Comparable
    {
        public Product2            p2             {get;set;}
        public Boolean             isSelected     {get;set;}
        public Integer[]             listTerm       {get;set;}
        
        public wProduct (Product2 p2)
        {
            this.p2      = p2;
            isSelected   = false;
            listTerm     = new Integer[]{0,0,0,0,0,0,0,0,0,0};
        } 
        
        public Integer compareTo(Object other)
        {    
            String otherName = other != null ? ((wProduct)other).p2.Name : ''; 
            return p2.Name.compareTo(otherName); 
        }
    } 

in class:
public  wProduct[]                  listWProduct                                {get;set;} 
listWProduct                        = new wProduct[]{};
for (Product2 p2 : [Select id,Name From Product2]) {
            listWProduct.add(new wProduct(p2));   
        }

 
  • January 13, 2015
  • Like
  • 0
Hello,

I am having an issue with my test class adderror on a trigger.

trigger Validation on ObjectA (before update) {
 
        for(ObjectA lstVAdd :  trigger.new){   

            if(lstVAdd.Supplier__c==null && lstVAdd.Status__c=='Closed' && lstVAdd.Comments__c ==null){
        Trigger.new[0].Supplier.addError(My Message);
           
                       }
        }
    }

Thank you
I have an inner class that has a method I want to call using a Map.  I get the following error when trying to save the VF Page.  The CommandLink line of code is causing the error.

Error Error: java.lang.UnsupportedOperationException
Error Error: null

Here is the code:
public with sharing class TestInnerClass
{
  class wA
  {
 
public  Account         a    {get;set;}
public wA(Account a){this.a = a;}
public void saveAcc(){upsert a;}
 
  }
  public Map<String,wA> mapWAcc {get;set;}

  public TestOuterClass()
  {
  mapWAcc  = new Map<String,wA>(); 
  mapWAcc.put('Test',new wA(new Account(Name='Test')));
  }
}

<apex:page controller="TestOuterClass">
<apex:form >
    <apex:repeat value="{!mapWAcc}" var="idMap">
    <apex:repeat value="{!mapWAcc[idMap]}" var="wAcc">
        <apex:inputField value="{!wAcc.a.Name}"/>
        <apex:commandLink value="Save" action="{!wAcc.saveAcc}"/>
    </apex:repeat>
    </apex:repeat>
</apex:form>
</apex:page>

Thanks
  • February 24, 2014
  • Like
  • 0

I ran all the Apex Unit Tests and 5 CMSForce classes are failing.  They all come from the trigger checkObjectAPIName with the error "The Object API name is not correct."  I believe it is not the code itself but some data in the system causing the problem.  However, I'm not sure how to research "this happens when the object's API name doesn't exist, or has been removed from the profile access settingsTypically when admin's don't setup the webform editor correctly"

Thanks

 

trigger checkObjectAPIName on Web_Form__c (before insert, before update) {

  //Map that holds all the object names and tokens in your org
  Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();

  for(Web_Form__c form:Trigger.New) {
        //just for other tests, provide a bypass to this one
        if(form.Object_Name__c.contains('testbypassx')) continue;
        //get a reference to the token related to the object referenced in the webform
        SObjectType sot = gd.get(form.Object_Name__c);
        //instantiate an object of this type
        try {
          SObject sobjectInstance = sot.newSObject();
        }
        //this happens when the object's API name doesn't exist, or has been removed from the profile access settings
        //Typically when admin's don't setup the webform editor correctly
        catch(System.NullPointerException ex) {
          form.addError('The Object API name is not correct.');          
        }

 

 

  • November 14, 2012
  • Like
  • 0

I am trying to use JQuery to display some text when some other text is moused over but it is not working.  Here is my current code.  Thanks.

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
  j$('[id$=hideshow]').mouseover(function(){
    j$('[id$=description]').show();
  });
  j$('[id$=hideshow]').mouseout(function(){
    j$('[id$=description]').hide();
  });
});
</script>

TABLE
<td style="text-align:left;vertical-align:middle;">
<apex:outputText value="{!wISL.ms.Name}" id="hideshow" /> 
<apex:outputText value=" {!wISL.ms.Service_Description__c}" id="description"/>
</td>   

 

  • September 27, 2012
  • Like
  • 0

Hello everyone,

is there any way how to call innerclass' method in visualforce page?

Thanks for answers in advance,

Karel.

So clearly IE9 is causing some major headaches with Visualforce. Rerenders completely broke with IE9 but forcing the browser to run in compatibilty mode is a decent short term fix: http://boards.developerforce.com/t5/Visualforce-Development/Ajax-doesn-t-work-in-IE9/td-p/259049 . This works great.... unless the page is being served from an iframe. If it is the hack won't work and the page breaks anytime a rerender is performed. This means inline VF pages still don't have a work around and any pages you may have in other iframes won't work with IE9.

 

This is a serious problem for us as we have several webforms integrated into other sites with iframes.

 

Here is some code and pages to reproduce. This page has the IE9 hack fix and works okay.

 

http://f5.test.cs1.force.com/iebug

Page:

 

<apex:page controller="IERerenderBug" showHeader="false" standardStylesheets="false">
    <apex:form >
        <apex:commandButton value="Go" action="{!doSomething}" reRender="output" status="status"/>
        
        <apex:actionStatus id="status">
            <apex:facet name="start">
                Doing something...
            </apex:facet>
        </apex:actionStatus>
    
        <apex:outputPanel id="output">
            {!time}
        </apex:outputPanel>
    </apex:form>
</apex:page>

Controller:

 

public class IERerenderBug {

    //Contructor
    public IERerenderBug(){
        //IE9 Visualforce hack
        String browserType = Apexpages.currentPage().getHeaders().get('USER-AGENT'); //gets the browser name 
        if(browserType != null && browserType.contains('MSIE')){
            Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
        }
    }
    
    public void doSomething() {
       system.debug('something');
    }

    public Integer getTime(){
        return system.now().second();
    }

The above works fine but if that page is in an iframe somewhere else the hack does not work:

http://f5.test.cs1.force.com/IEiframe

Page:

<apex:page showHeader="false">
    This is an iframe of IEBug page... hack doesn't work if page is in an iframe.
    <iframe width="100%" height="200" frameborder="1" src="{!$Page.IEBug}"></iframe>
</apex:page

 

Does anyone know of any tricks or hacks to get this working when the page is in an iframe?

 

Thanks,

Jason

  • March 23, 2011
  • Like
  • 0

Hello,

 

I've instaled Milestones PM - Project Management however when I click on Initialize the app I get the following error:

 

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Task_Trigger: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: LIMIT_EXCEEDED, Maximum per user subscription limit reached.: [] Class.Milestone1_Task_Trigger_Utility.handleTaskAfterTrigger: line 65, column 9 Trigger.Milestone1_Task_Trigger: line 8, column 3: []

 

An unexpected error has occurred. Your development organization has been notified.

 

 

Can anyone help?

 

Thanks

Matt

We have a trigger on Task that has been working fine for over a year. Recently, an admin tried to add a number of recurring Tasks via the data loader and received the error message "UNSUPPORTED_APEX_TRIGGER_OPERATION:Apex Task trigger cannot handle batch operations on recurring tasks."

 

I thought I could update the trigger to check for recurring tasks but that still doesn't resolve the problem. Has anyone come across this error and, if so, how did you resolve it?

-greg

  • January 13, 2010
  • Like
  • 0