• OSJMgr
  • NEWBIE
  • 30 Points
  • Member since 2005

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

I am having rendering issues when I create a word doc from a visualforce page containing a Rich Text Area field.  The spaces after a period render as a  (capital A caret).  It seems this is some type of text encoding translation error.  Any idea how to fix this? 

 

I have tried using put outputField and outputText with escape="false".  It's a real annoyance to my users to have edit these out before they save the word doc.

 

 

  • August 04, 2012
  • Like
  • 0

This has been brought a hundred times before, but my problem must be unique.  I cannot see any of my visualforce pages in the Content drop down when I want to create a detail page custom button.  The page I am trying to select contains the standardcontroller of the SObject for which I am trying to create the button.

 

I can see my scontrols, but why can't I see my pages if they contain the correct standardcontroller?  Note, this is for a simple detail page button, not a list button.

Hi All:

 

I receive the following error when I click on a commandbutton in a visualforce page that calls another page to execute Apex code:

 

Maximum view state size limit (128K) exceeded. Actual viewstate size for this page was 182.391K

 

The wierd thing is, is that it works fine in the Sandbox, but not in production.

 

There are a couple of other posts regarding this issue, however, they specifically address trying to attach a file via a visualforce page.  I am not trying to do that.  I just have a very large page that includes a tabpanel.  On the conclusion tab, I include a list of child records with the ability to conduct inline editing using the apex:repeat tag and a controller that uses a SOQL statement to return the records.

 

Please Help!

 

Here is an excerpt of the code:

 

 

 

public class supissuesController {
 // class variables
 Inspection__c insp;
 Supervisory_Issue__c[] supissue; 
 public String strID = 'unset';
 
 public supissuesController() {
    }
    
  
 public supissuesController(ApexPages.StandardController controller) {
     this.insp = (Inspection__c)controller.getSubject();
     
     System.Debug('DEBUG: CALLING CONSTRUCTOR');
     this.supissue = [ SELECT 
      SystemModstamp, Name, 
      LastModifiedDate, LastModifiedById, LastActivityDate, 
      IsDeleted, Id, CreatedDate, CreatedById, 
      Category__c, Type__c, Issue_Notes__c, Follow_up_Type__c, 
      Follow_up_Notes__c, Status__c, Resolution_Type__c,Resolution_Date__c ,Referred_to_FFS_Compliance__c,
      Notes_to_Compliance__c
      FROM 
      Supervisory_Issue__c
      WHERE 
      Inspection__c = :insp.id 
      ORDER BY Category__c ASC];
     
      }
 
 // Action Method called from page button
 public pagereference saveChanges() { 
  upsert this.supissue;
  return null;
  }
 
 public PageReference  getstrID() {
     PageReference pageRef = ApexPages.CurrentPage();
     pageRef.getParameters().put('strID', strID );   
     return pageRef ;     
     }
     
 // Action Method called from page link
 public pagereference newSupervisoryissue() { 
  Supervisory_Issue__c d = new Supervisory_Issue__c();
  d.Inspection__c =this.insp.id; 
  supissue.add( d );
  return null;
 }
 
 // public Getter to provide table headers 
 public string[] getheaders() { return new string [] 
  {'Name', 'Category','Type', 'Issue Notes',
   'Follow-up Type', 'Follow-up Notes', 'Issue Status','Resolution Type','Closed Date',
    'Refer Compliance?','Compliance Notes' } ; }
 
 // public Getter to list related supervisory issues
 public Supervisory_Issue__c[] getSupervisoryissue() { 
  return this.supissue; 
 } 
     
  public pageReference  CallInsertClass() {    
     String strPage = '/apex/CallInsertClass?';
     ID InspID = System.currentPageReference().getParameters().get('id');
     Inspection__c insp  = [select RR_DM__c from Inspection__c where ID = :InspID LIMIT 1];     
     
     strPage += 'InspID=' + InspID;
     strPage += '&ContID=' + insp.get('RR_DM__c');
     
     Pagereference  midPage = new Pagereference(strPage);    
     midPage.setredirect(true);
    
     return midPage ;     
     }  
 
 public pageReference InvokeNewRcdCreator    () {
     Inspection__c[] Insp_recs= new List<Inspection__c>();
     ID InspID = System.currentPageReference().getParameters().get('InspID');
     ID ContID = System.currentPageReference().getParameters().get('ContID');
     ID RRID;

     String strSOQL;
     Schema.DescribeFieldResult InspFld;
     Integer FldCount = 1;     
     String strPage = '/apex/rrbydminsp?id='+InspID;
     Schema.DescribeSObjectResult InspResult;
     
     Map<String, Schema.SObjectField> InspMap = new Map<String, Schema.SObjectField>();
     InspMap = Schema.SObjectType.Inspection__c.fields.getMap(); 
     
     List<Schema.SObjectField> InspList = InspMap.values() ;     
     
     System.Debug('InspID: ' + InspID );
     System.Debug('PAGEREF: ' + System.currentPageReference().getURL());
         
     String strInsp_flds = '';

     InspFld= InspList.get(0).getDescribe();                
     strInsp_flds = InspFld.getName(); /// build the first one....
     for( Integer i = 1 ; i < InspList.size() ; i++ ){
        InspFld= InspList.get(i).getDescribe();                
        strInsp_flds += ','+InspFld.getName();
        FldCount++;        
        }    
             
     //DEBUG
     //InspID = 'a0ES0000001BM6v';
     strSOQL = 'SELECT ' + strInsp_flds + ' FROM Inspection__c WHERE Id=\''+InspID+'\' LIMIT 1';
     System.debug('SOQL for Inspection__c : ' + strSOQL );
     
     Insp_recs= Database.query(strSOQL );
     RRID = Insp_recs[0].RR_DM__c;
     Contact dummyCont  =[select OwnerID  from Contact  where ID = :RRID  LIMIT 1];
     RRID = dummyCont.OwnerID;
     Supervisory_Issue__c sup_issue ;
     
     //
     // START CREATING RECORDS
     //     
     /// first:   Create a Supervisory record and start working on it....
     integer RcdsCreated = 0;     
       
     if (Insp_recs[0].RRDMUnrslvdDef__c == True) {
          sup_issue = Init_SupRcd(InspID, ContID, RRID);          
          sup_issue.Issue_Notes__c = 'Issues from previous inspection' ;
          sup_issue.Issue_Notes__c += ' were not resolved by current inspection. ';
          sup_issue.Issue_Notes__c += ' Noted by DM during the RRs ';
          sup_issue.Issue_Notes__c += Insp_recs[0].Inspection_Year__c; 
          sup_issue.Issue_Notes__c += ' inspection conducted on ';
          sup_issue.Issue_Notes__c += Insp_recs[0].Inspection_Date__c;
          sup_issue.Issue_Notes__c += '. See hardcopy inspection checklist ';
          sup_issue.Issue_Notes__c += 'or contact the ROSJ for additional details. ';
          sup_issue.Issue_Notes__c += 'Details: ' + Insp_recs[0].RRDMUnrslvdDefNotes__c;                             
            
          if(Insp_recs[0].Inspection_Date__c != null) {
              sup_issue.Event_Date__c = Insp_recs[0].Inspection_Date__c;
              }
        
          if(Insp_recs[0].Date_Reviewed__c != null) {
              sup_issue.Date_Reported__c = Insp_recs[0].Date_Reviewed__c;
              }
        
          sup_issue.Category__c =  'Inspection';
          sup_issue.Type__c =  'Unresolved Inspection Deficiencies';
          sup_issue.How_Discovered__c =  'Office Inspection';
          sup_issue.Discovered_By__c =  'District Manager';
          sup_issue.Status__c =  'Closed';
          sup_issue.Follow_up_Type__c = 'Other';
          sup_issue.Resolution_Type__c = 'Other';
          sup_issue.Resolution_Date__c = Date.today();
          insert sup_issue;
          RcdsCreated++;
          } //repeats several times
///
     /// -- Logical end of Controller -- now do cleanup     
     ///Insp_recs[0].DebugCnt__c = RcdsCreated;
     //return(RcdsCreated);
            
     strPage  = strPage + '&rcds=' + RcdsCreated;
     Pagereference  lastPage = new Pagereference(strPage); 
     ///System.debug('REDIRECT page: ' + strPage);
     lastPage.setredirect(true);

     return lastPage ;          
     }
 
 public Supervisory_Issue__c Init_SupRcd(ID InspID, ID ContID, ID RRID) {
     Supervisory_Issue__c sup_issue = new Supervisory_Issue__c();
     sup_issue.Inspection__c = InspID;
     sup_issue.DM_RR__c = ContID ;
     sup_issue.Assigned_To__c = RRID;     
     return sup_issue;
     }
     
 public integer BoolCheck(boolean bChkVal) {
  integer retVal = 0;
  if (bChkVal == True) 
      retVal = 1;
  return retVal;
  }

}
 
  • March 16, 2010
  • Like
  • 0
Does anyone have any idea how to run an Scontrol from a Hyperlink formula field?  So far, I can only get the scontrol to work as a custom link.
 
Thanks,
  • November 16, 2006
  • Like
  • 0
I finally figured out a way to pass a date to another custom object via the Hyperlink formula field function.  Since hyperlink is a text function that passes info via the URL, it won't normally allow a date type field.  Please let me know if there is an easier way.
 
Here is how I did it (warning, this is ugly):
 
Date field = {!Date__c}
 
1.  Create 3 custom formula fields as follows:
  • Year1 = Year({!Date__c})
  • Month1 = Month({!Date__c})
  • Day1 = Day({!Date__c})

2.  Convert each of these fields to text by creating 3 more formula fields:

  • Year2 = Text({!Year1__c})
  • Month2 = Text({!Month1__c})
  • Day2 = Text({!Day1__c})

3.  Create 3 custom TEXT fields on the object that you will be passing the date to:

  • Year1
  • Month1
  • Day1

4.  Create 3 customer NUMBER formula fields to convert the text to numbers:

  • Year2 = VALUE({!Year1__c})
  • Month2 = VALUE({!Month1__c})
  • Day2 = VALUE({!Day1__c})
  • 5.  Reassemble these three fields using a DATE formula field:

    DATE(Year2, Month2, Day2)

    Pass the Year2, Month2, Day2 fields on the first object to the Year1, Month1, Day1 fields on the second object through the normal Hyperlink function.

  • November 13, 2006
  • Like
  • 0
Hello:
 
I am trying to reference a look-up field in a custom formula.  Unfortunately, the formula ignores the contents of the lookup field.  Does anyone have any ideas how I can get around this?
  • November 01, 2006
  • Like
  • 1
I need to pass date and text area (255) fields using the hyperlink function.  However, I always get a syntax error message.
 
Any ideas?
  • October 16, 2006
  • Like
  • 0
Hello:
 
I need a simple Scontrol activated by a custom link that can pass a custom field from a child record to a field on the parent record.  Does anyone have any simple code that I can easily customize?
 
Thanks,
  • April 26, 2006
  • Like
  • 0
Hello:
 
I am trying to reference a look-up field in a custom formula.  Unfortunately, the formula ignores the contents of the lookup field.  Does anyone have any ideas how I can get around this?
  • November 01, 2006
  • Like
  • 1

I am having rendering issues when I create a word doc from a visualforce page containing a Rich Text Area field.  The spaces after a period render as a  (capital A caret).  It seems this is some type of text encoding translation error.  Any idea how to fix this? 

 

I have tried using put outputField and outputText with escape="false".  It's a real annoyance to my users to have edit these out before they save the word doc.

 

 

  • August 04, 2012
  • Like
  • 0

This has been brought a hundred times before, but my problem must be unique.  I cannot see any of my visualforce pages in the Content drop down when I want to create a detail page custom button.  The page I am trying to select contains the standardcontroller of the SObject for which I am trying to create the button.

 

I can see my scontrols, but why can't I see my pages if they contain the correct standardcontroller?  Note, this is for a simple detail page button, not a list button.

Hi
I would like to create a custom field on the Account tab that calculates a customer's total expenditure. The only way I can think of doing this is to add all the Amounts for the Closed Won Opportunities related to the Account. When I try to create a formula in a custom field I only seem to be able to reference field on that tab (Accounts). Does anyone know how to made this work or suggest an alternaltive method?
 
We do not currently use Products so I would be interested to know if this gives us the functionality I'm after.
 
Thank you
 
Kerry
  • September 19, 2006
  • Like
  • 0
I'm a total newbie to Salesforce.  My company is using the Scribe Sales Order plugin/ app and I have to create a field that is derived from the total price of all Sales Order Items (i.e. a sales order total).

Sales Order is one object, Sales Order Item is another, which has Sales Order as it's master.

I expected it to be a customer formula in Sales Order like this; {!LineItemAmount__c:SUM}
but this won't even validate.

{!LineItemAmount__c} validates OK - it is in the custom fields drop down but it comes out as 0  when it's applied, even though there are Sales Order Items, each with total prices, so I'm guess it is not the right one to use anyway.

The Sales Order Item has a custom field available for the amount I'm after, referenced like this
{!TotalPrice__c}

What I need to do is add up the {!TotalPrice__c} for all Sales Order Items in a particular Sales Order.  Does that make sense - if so, can I do it?

Thanks in advance

Ben



  • August 16, 2006
  • Like
  • 0
I am trying to generate a report that will average the number of days that an opportunity spends in certain stages of our sales process.  I have fields in each opportunity that calculate the number of days per stage, but the problem that I am running into when generating the report is that many of the opportunities have not reached the final stages.  When I average that column, the report totals the number of days for all opportunities and then divides by the total number of opportunities.  I need it to just divide by the number of opportunities for which there is a value present.  For example, if only two opportunities have reached the final stage and have values of 10 and 14, but there are 8 total opportunities in the report, the report returns an average of  3 instead of 12.  I currently have the fields setup so that they treat blank values as blanks.  Does anyone know if this possible, and if so, how would I do this?  Thanks.