• SSRS2
  • SMARTIE
  • 515 Points
  • Member since 2010

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

 

<apex:outputLabel style="">
              <apex:commandButton action="{!add}" value="add"/>
              <apex:commandButton value="Search" action="{!Searchs}" onclick="return SearchClick()"/>
              </apex:outputLabel>

 use css styles like this

 

 <table width="100%">
                  <tr>
                      <td align="center">
                          <apex:commandButton action="{!add}" value="add"/>
                          <apex:commandButton value="Search" action="{!Searchs}" onclick="return SearchClick()"/>
                      </td>
                  </tr>
              </table>

 thanks for your help!

 

 

 

Hello,

when im running the belo code as a system administrator its working fine. But while running the code as a standard platform user its giving me this error. "Id value is not valid for Topic__c standard controller”

Please help me solve this error.

 

my apex class is:

 

public class Topic {

 public Topic(ApexPages.StandardController ctrx)  
 
  { 
         c1=new Topic__c();
         m=new message__c();
        
  
   }
 

The page from which it was redirected:

 

<apex:page StandardController="Topic__c" extensions="Topic" >
<apex:form id="form"  >
<apex:pageBlock >
        <apex:pageBlockSection title="Topics First page"  >
        
             <apex:pageBlockTable value="{!emp}" var="item">

                    <apex:column value="{!item.name}"/>
                    <apex:column value="{!item.description__c}"/>
                    <apex:column headerValue="Action" style="white-space: nowrap">
                        <a href="/apex/post_page?id={!item.id}">Post Message</a>
                    </apex:column>

             </apex:pageBlockTable>
                  
        </apex:pageBlockSection>
    
</apex:pageBlock>
<apex:commandButton action="{!new1}" value="new" >
</apex:commandbutton>

</apex:form>
</apex:page>

 

The page to which it was redirected:-

 

<apex:page standardController="Topic__c" extensions="Topic" >
<apex:form >
   
    <apex:pageBlock >
     
        <apex:pageBlockSection title="New Post Page" columns="1" >
            <apex:outputField value="{!Topic__c.description__c}"/>

            <apex:pageBlockTable value="{!MessageList}" var="item">
                <apex:column value="{!item.text__c}"/>
            </apex:pageBlockTable>
           
            <apex:inputField value="{!m.text__c}"/>
           
            <apex:commandButton value="Save" action="{!save1}"/>
        
        </apex:pageBlockSection>
   
    </apex:pageBlock>


</apex:form>
 
</apex:page>

Hi,

i want to  create a custom action '{!toadd}' for customObject 'UserProfiles__c' in the vf page.

 

i hav written the following code:

 

/* visualforce page  */

<apex:page standardController="UserProfile__c" extensions="LeaveAppClass">
    <div align="center" style="font-family:forte;font-size:18pt;color:brown;background:wheat">
        <h1>Leave Application</h1>
    </div><hr/>
    <apex:form >
        fromadd :{!UserProfile__c.emailID__c}<br/>
        toadd :{!toadd}<br/>
        subject :<apex:inputtext id="subject" size="40"/><br/>
    </apex:form>
</apex:page>

 

/* Extension class LeaveAppClass */

public class LeaveAppClass
{   
    ApexPages.StandardController con;
    public LeaveAppclass(ApexPages.StandardController controller)
    { 
        con = controller;
    }
    public String toadd()
    { 
        String emailID;
        Userprofile__c ucon = [select emailID__c from Userprofile__c where Role__c =: 'HR'];
        hremailID = ucon.emailID__c;       
        return emailID;       
    }
}

 

I am getting an error as:

ErrorError: Unknown property 'UserProfile__cStandardController.toadd' 

 

what could be the problem. I am new Visualforce and apex....help me

Hello,

 

I have checked the boards and tried the samples, but for some reason when I used this bit of code to format my currency:

 

         <apex:outputText value="Rs{0,number, $###,##0.00}">
             <apex:param value="${!opp.Total_Referrals__c}"/>
         </apex:outputText>

 

I get this error:

 

Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

I'm clueless in what to do. I merely wish for a basic currency formatting technique. If you can offer any advice, I'd be appreciative.

  • October 18, 2010
  • Like
  • 1

Hi,

 

  i am new to the salesforce, please help me to do this

 

how to Display the values of some fields of custom object in the visualforce page.

 

i hav written like this: (it is not displaying the field values)

 

<apex:page standardController="UserProfile__c">

 

Welcome {!UserProfile__c.empName__c}

 

your role is {!UserProfile__c.Role__c}

 

</apex:page>

 

here UserProfile__c is a custom object and ampName__c and Role__c are fields in that object.

I have been working on a custom pdf page with CSS for quite a while and have not been able to standardize spacing between text lines within a mult-line field (billing address). What do I need to change to add the uniform spacing? I have not moved my css into an external style sheet, though I plan to.

 

 

My challenge is with this portion of the page:

 

                <apex:outputField value="{!quote.BillingAddress__c}" styleClass=" header3" />
                <apex:outputField value="{!quote.Created_Date__c}" />
                <span style="margin-left:-176px; margin-top: 500px;">
                <apex:outputLabel value="">
                <apex:outputField value="{!quote.BillingAddress2__c}"/>
                </apex:outputLabel>
                                </span>
                <span style="float:left; margin-left:0px; margin-top:-15px;">
                <apex:outputField value="{!quote.ExpirationDate}"/>
                                </span>
                <span style="float:left; margin-left:-176px; margin-top:-15px; z-index:-8;">
                <apex:outputLabel value="">
                <apex:outputfield value="{!quote.BillingCountry}"/>
                </apex:outputLabel>
                </span>   

 

 

 

 

Here is the entire visualforce page. I am not including the apex controllers as they are not applicable for this question.

 

<apex:page standardController="Quote" extensions="dataTableCons" standardstylesheets="false" renderAs="pdf" showHeader="false">
<head>
<style>
body { font-family: Arial Unicode MS; font-size: 10 px; } 

h3 {
    display:block; width:637px; padding:0; background:#ADD8E6;
    font-size:12px; line-height:23px; text-align:left; font-weight:normal;
}
h4 {
    display:block; width:637px; padding:0; 
    font-size:10px; line-height:12px; text-align:left; font-weight:normal;
}
h5 {
    display:block; width:637px; padding:0; 
    font-size:8px; line-height:12px; text-align:right; font-weight:normal;
}

.header
{
 width: 367x;
 height: 5px;
 background-color: gray;
 color: White;
 font-size:8pt;
 text-align: left;
 padding-left: 5px;
}
.header1
{
 width: 15px;
 height: 5px;
 background-color: gray;
 color: White;
 font-size:8pt;
 text-align: right;
 padding-left: 10px;
}
.header2
{
 width: 65px;
 background-color: gray;
 height: 5px;
 color: White;
 font-size:8pt;
 text-align: right;
 padding: 5px;
}

.tabletop {
    display:block; width:630px; height:5px; 
    background:transparent url(images/top.gif) no-repeat scroll 0 0;
    margin:0 0 0 4px;
}
.tablebk {
    width:615px;
    background:transparent url(images/middle.gif) repeat-y scroll 0 0;
    margin:0 0 0 4px; padding:0 0 0 15px;
}
.tablebottom {
    display:block; width:630px; height:16px; 
    background:transparent url(images/bottom.gif) no-repeat scroll 0 0;
    margin:0 0 0 4px;
}

table {table-layout:fixed; border-collapse:collapse; border-spacing:0; }

th {
    color:#fff; 
    font-size:14px; line-height:10px;
    padding:5px 6px 8px;
    vertical-align:top;
}
td {
    
    font-size:10px; line-height:10px;
    padding:3px;
    vertical-align:top;
}
th.col1,
td.col1 {text-align:left;}
.odd td {background-color:#f2f7fa;}

td input {
    width:85px; height:22px;
    font-size:14px; line-height:16px; font-weight:bold; text-align:left;
    padding-top:3px;
    border:null;
}

tr:hover td {background-color:#599bbd;} /* hover state does not work in ie6 */

/* table1 */
.table1 th.col1 {width:176px; }
.table1 th.col2 {width:181px;}
.table1 th.col3 {width:173px;}
.table1 td {padding-bottom:5px;}
.table1 td.col3 {padding-top:6px; padding-left:19px;}

/* table2 */
.table2 th.col1 {width:176px;}
.table2 th.col2 {width:181px;}
.table2 th.col3 {width:173px;}

/* table3 */
.table3 th.col1 {width:128px;}
.table3 th.col2 {width:153px;}
.table3 th.col3 {width:130px;}
.table3 th.col4 {width:95px;}
.table3 td {padding-bottom:5px;}
.table3 td.col4 {padding-top:6px; padding-left:19px;}
/* END Table CSS */


</style>
</head>

    <apex:form id="theForm">  
       <apex:pageBlock tabStyle="account">
            <apex:pageMessages />
         <apex:image url="/resource/1272645408000/Key_Logo" width="20%" height="20%"/>
           <Table class="table">
           <apex:pageBlockSection title="Essential Information" columns="2"  showHeader="false">
                <apex:outputField value="{!quote.Opportunity.AccountId}" styleClass="line-height='133px'" />
                <apex:outputField value="{!quote.quotenumber}" />
                <apex:outputField value="{!quote.BillingAddress__c}" styleClass=" header3" />
                <apex:outputField value="{!quote.Created_Date__c}" />
                <span style="margin-left:-176px; margin-top: 500px;">
                <apex:outputLabel value="">
                <apex:outputField value="{!quote.BillingAddress2__c}"/>
                </apex:outputLabel>
                                </span>
                <span style="float:left; margin-left:0px; margin-top:-15px;">
                <apex:outputField value="{!quote.ExpirationDate}"/>
                                </span>
                <span style="float:left; margin-left:-176px; margin-top:-15px; z-index:-8;">
                <apex:outputLabel value="">
                <apex:outputfield value="{!quote.BillingCountry}"/>
                </apex:outputLabel>
                </span>                
             </apex:pageBlockSection>

            <apex:pageBlockSection title="Contact Info" showHeader="true" >
                <apex:outputField value="{!quote.contactid}"/>
                <apex:outputField value="{!quote.Phone}"/>
                <apex:outputField value="{!quote.email}"/>
                <apex:outputField value="{!quote.fax}"/>
             </apex:pageBlockSection>

            </Table>

       </apex:pageBlock>
       
       </apex:form>

    <apex:pageBlock >
    <apex:pageBlockSection columns="2">
      <apex:dataTable value="{!Quote.QuoteLineItems}" rowClasses="even,odd," var="line"  width="630">
        <apex:column style="text-align:right;" headerClass="header1" headerValue="Item">
        <apex:facet name="Item">Item</apex:facet>
        <apex:outputText value="{!line.Quote_Item_Number__c}"/>
        </apex:column>  

        <apex:column style="text-align:left;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;"
          headerClass="header" headerValue="Product">
        <apex:facet name="header">Product</apex:facet>
        <apex:outputText value="{!line.PriceBookentry.name}"/>
        </apex:column>        
        <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Quantity">
        <apex:facet name="header">Quantity</apex:facet>
        <apex:outputText value="{!line.Quantity}"/>
        </apex:column>
    <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Price Each">
        <apex:facet name="header">Price Each</apex:facet>
        <apex:outputText value="{!line.ListPrice}"/>
        </apex:column>
    <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Price Each">
        <apex:facet name="header">SubTotal</apex:facet>
        <apex:outputText value="{!line.Subtotal}"/>
        </apex:column>        
      </apex:dataTable>
      </apex:pageBlockSection>
   </apex:pageBlock>
  
        <apex:form >      
       <apex:pageBlock >
       <apex:pageBlockSection columns="2">
       <apex:inputhidden />
       <apex:inputhidden />
       <apex:inputhidden />
       <apex:outputField value="{!quote.Grand_Total__c}" style="h5" />
       </apex:pageBlockSection>

       </apex:pageBlock>
       <apex:pageBlock >
       <h4>
       This quotation is provided for budgetary planning purposes only. 
       This is not an official offer of sale, orders cannot be placed against this budget quotation. 
       Once project details have been fully defined, a final detailed quotation will be submitted.
       </h4>
       </apex:pageBlock> 
      </apex:form>

</apex:page>

 

HI All,

 

string res = 'I ' m a Apex Dev.';

 

how to replace single quote(') to \'.

this value send to visual force page javascript validations.

 

Regards

Ravi

 

Hi All,

 

 I am trying to show date time with Apex:outputtext using the below code:

 

<apex:outputText value=" {0,date,MM/dd/yy HH:mm a}">
       <apex:param value="<DateTime field>"/></apex:outputText>

The result of this is date is coming in GMT timezone. Please let me know how can we show it in user's timezone.

 

thanks!

  • October 13, 2010
  • Like
  • 0

Hi all,

 

I have created two pages, by name 'A' and 'B'.

 

What I require is, if I click 'Click here for B' link from the page 'A' the popup window should appear and display the page 'B' after filling the details in page 'B' when i click 'Ok' button of the page 'B', the page 'B' should disappear and the page 'A' should be continued.

 

Any help regarding this will be highly appreciated.

 

Note that I want to do this with out using java script.

 

Thanks in Advance.

  • October 08, 2010
  • Like
  • 0

Hi guys, I really needs help, I want to add the data to my custom object. but, it does not work? I search the answer all over the community. Can anyone help me? I tried using Account as standard controller and it works and when I try my own custom object, it does not work. Do I missed something here?

 

 

<apex:page standardController="GetSatisfaction_Properties__c"  >
    <apex:form >
        <apex:inputField value="{!GetSatisfaction_Properties__c.Community_name__c}" />
        <apex:inputField value="{!GetSatisfaction_Properties__c.Username__c}"/>
        <apex:inputField value="{!GetSatisfaction_Properties__c.Password__c}"/>                    
    </apex:form>            
</apex:page>

 

 

Regards,

Abi Dzar

Hi all,

 

I have custom VF page and a custom controller for it. I have one custom object which has custom field Account__c.

Account__c has master detail relationship with standard object "Account" . Using input field tag i want to show it on

VF page as a lookup field for accounts.

 

I am using

<apex:inputField id="account" value="{!acfContract.Account__c}"/>

 

I am not getting any error.

But on VF page only label account is displayed and not lookup tab.

 

Please help me.

I need to use it in order to make a javascript function work. Here I paste the entire visualforce page (don't worry, it's small): 

 

 

<apex:page >
    
    <apex:form id="morning">
    
    <apex:commandButton onclick="beforeTextSave();" value="Button" reRender="msgpost"/>
    <apex:outputText id="msgpost"/>
    
  
    
    </apex:form>
  
    <script>
        function beforeTextSave() {
            document.getElementById('{!$component.morning.msgpost}').value = 'Hello World';
        }
    </script>
    
</apex:page

 

 

It's supposed when I press the button, a message ("Hello World") should appear in the screen. But for some reason I can't make it work :'(

 

Do you know what is wrong in my code?

 

 

Cheers.

  • September 20, 2010
  • Like
  • 0

I try to create the page from here: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm

 

I've made a page:

 

 

<apex:page renderAs="pdf">
    <style> body { font-family: Arial Unicode MS; font-size:72px;} </style>
    <h1>Congratulations</h1>
    <p>This is your new PDF</p>
</apex:page>

 

 

But styles was not applied. How can I use css in PDF? Why does this code sample not work for me?

 

Thanks a lot.

 

Mikhail

I have the following text file I uploaded as a static resource:

 

 

.centertext {

text-allign:  center;

}

 

 

I am using the tabbed account and I have a controller extension that exposes some lists (because I want to split a custom object into 3 tabs based on record type.) I am trying to center 2 of the columns in the below section of the VF page (Base Members and Current Members) .. I added the reference at the top of the VF page to the static resource as follows:

 

 

<apex:page standardController="Account" extensions="EnrollmentAcctExt" showHeader="true" 
      tabStyle="account" standardStyleSheets="false">
      <apex:stylesheet value="{!URLFOR($Resource.AccountStyle, 'AccountStyle.css')}"/>

 and here is my pageblock that brings in the listing... however, the base members field is not centering:

 

 

 

<apex:tab label="Health Enrollment" name="HealthEnrollment" id="HE" styleclass="AcctListStyle">          
        <apex:pageBlock mode="edit" title="Health Enrollment Current">
           <apex:form >
            <apex:commandButton action="{!NewEnrollHealth}" value="New"/>
           </apex:form>
         <apex:pageblockSection id="key" title="">
          <apex:pageblockTable value="{!healthsummaryactive}" var="hs"> 
              <apex:column headervalue="Health Enrollment Name">
                  <apex:outputLink value="/{!hs.id}">{!hs.Name}</apex:outputLink>
              </apex:column>  
              <apex:column headervalue="Year">
                <apex:outputField value="{!hs.Year__c}"/>
              </apex:column> 
              <apex:column headervalue="Market">
                <apex:outputField value="{!hs.Market__c}"/>
              </apex:column> 
              <apex:column headervalue="Category">
                <apex:outputField value="{!hs.Category__c}"/>
              </apex:column> 
              <apex:column headervalue="Status">
                <apex:outputField value="{!hs.Status__c}"/>
              </apex:column> 
              <apex:column headervalue="Base Members">
                <apex:outputField value="{!hs.Base_Members__c}" styleClass="centertext"/>
              </apex:column> 
              <apex:column headervalue="Current Members">
                <apex:outputField value="{!hs.Current_Members__c}"/>
              </apex:column> 
          </apex:pageblocktable>
         </apex:pageblockSection>
        </apex:pageblock> 

 Do I have something in the wrong place or is my css file wrong?  Any help is greatly appreciated!!!! Thanks!!

 

Fred

 

  • September 15, 2010
  • Like
  • 0

Hi,

 

 I am having a Picklist with 3 options: None, Commercial and Rolloff.

 

If None is selected then the below two sections in VF page should be hidden.

If commercial/Roll Off is selected then the below 2 sections should be shown to the user to enter the data.

 

Anyone please help me doing this.

 

Appreciate your help.

 

Thankyou,

Carol

  • September 04, 2010
  • Like
  • 0

What are the standard Salesforce CSS Colors for the tabs?

 

-Thanks

 

 

<style>
      .activeTab {
        background-color: ????;
        color:white;
        background-image:none
      }
      .inactiveTab {
        background-color: ????;
        color:black;
        background-image:none
      }
</style>

 

 

Hi all,

 

I have a problem with merging the date field into the visualforce page.

I used {!Oppr.Entry_Date__c} it displayed "Tue Aug 10 00:00:00 GMT 2010".

I require the format to be "Tue Aug 10 2010".

How to change the format to achieve my requirement.

Any help regarding this will be appreciated.

 

Thanks in Advance.

  • August 09, 2010
  • Like
  • 0

 

Hello

 

I have tried the css clipping property. Here I have noticed that it works in html output and not when it is pdf. 

 

This is my vf code 

 

<apex:page renderAs="pdf" showHeader="false"><div style="clip: rect(0px, 30px, 30px, 0px);position:absolute;"> aaaaaaaaaaaaaaaaaaaaaaaaaaaa</div></apex:page>

 

 

Any alternative css style for clipping when it is pdf? 

 

Thanx

 

 

 

  • October 13, 2010
  • Like
  • 0

I want to get Blob from external image URL but thrown exception.

 

Apex Debug Log :

 


System.VisualforceException: java.net.ConnectException: Connection timed out

see following sample code :

 

public PageReference testPageRefExternalURL() {
      PageReference pr = new PageReference('http://www.google.com/intl/en/images/logos/translate_logo.gif');
      try {
        Blob blobImage = pr.getContent();
      } catch (Exception ex) {
        throw ex;
      }
      return pr;
    }

   I have added 'http://www.google.com'  to 'Remote Site Settings' but still exception is thrown.If I save image in static      resource and get the URL it is work fine.

 

  -Suresh

 

  • September 15, 2010
  • Like
  • 0

I want to get values with middle spaces but only show one space in output (Salesforce.com API version 19.0).

VF page:

<apex:page controller="TestSpace">
<apex:outputText value="A B"></apex:outputText><br/>
<apex:outputText >A C</apex:outputText><br/>
<apex:outputText value="{!fromController}"></apex:outputText><br/>
<apex:outputText >A E</apex:outputText><br/>
</apex:page>

 Apex Class:

public class TestSpace {
public String getFromController() {
return 'A D';
}
}

Output:

  A B  //not expected

  A C //not expected

  A D //not expected

  A E //ok

 

-Suresh


  • August 31, 2010
  • Like
  • 0

If use

 

<input type="checkbox" value="Bike" checked="{IF(false,'checked' ,'')}"/>

Always checkbox is checked. But it should be unchecked

 

 If use

 

<input type="checkbox" value="Bike" checked=""/>

 Checkbox is unchecked

 

  What is the different of

    checked="{IF(false, ‘checked' ,'')}" & checked=""

 

How I toggle checked state dynamically with a custom condition ?.

(Salesforce.com API  VF page version is 19.0)

 

-Suresh

  • July 30, 2010
  • Like
  • 0

I have a customer requirement to display a PDF document with various parts of it in "small caps". If I display the document as a regular VF page, its fine. However, when I add the renderAs="PDF" attribute, the small caps disappear. The document is complex with many styling changes and requires a separate style sheet. However, the problem is easy to demonstrate with a simple document, e.g.:

 

<apex:page sidebar="false" standardStyleSheets="false" showHeader="false">
<style type="text/css">
p {font-variant:small-caps;}
</style>
<p>This should be small caps.</p>
</apex:page>

 

The above works as expected.  However, add in the renderAs, and the small caps disappear!

 

I have tried everything. I've tried setting the body selector, I've tried spanning with a class or an id. I've used a separate style sheet, wrapped the text in an apex:outputText tag and then added style and/or styleclass attributes to the apex tag. I've tried specifying font families (which is a real shot in the dark since I've found no documentation on what fonts are available to SFDC's iText instances.)

 

Has anybody seen this before or have a solution or know if this a confirmed bug? [My OS is WinXP SP3 5.1.2600 (i.e. fully up to date) and my Adobe Reader is 8.2.5 (i.e. fully up to date)]

 

I can think of a workaround but for large docs, its ugly. You would change the required words to uppercase and use two fonts, one for trailing parts of words and a larger one for the leading character, where needed.

I am creating a visualforce page that renders as pdf and I am trying to include an image but am running into an issue.  I have tried to store the image in the static resources, as well as in a document folder but neither option works. 

 

When I am logged in as the system admin the image appears on the PDF, but if I log in as any other user it appears broken. 

 

Below is the code on the visualforce page for image:

 

From Document library:

<center>
     <apex:image value="/servlet/servlet.FileDownload?file=015S000000Hz2u" width="262" height="50"/>
</center>

 

From Static Resources:

<center>
     <apex:image value="{!resources.logo}" width="262" height="50"/>
</center>

 

Any help would be great!

  • October 29, 2010
  • Like
  • 0

Hi,

 

I got the error 'Invalid argument type for function datevalue()' when I include the markup tag <apex:column value="{!datevalue(mt.createdDate)}"/>  where mt is a custom object.

 

To my understanding, createdDate is a system datetime field.  Do anyone know why it is an invalid argument type for datevalue()?

 

Thanks

Danny

I have simple visualforce page on a custom tab with several outputLinks to other pages.  I want the links to keep the same tab highlighted.  I have tried using tabStyle to set it to the controller for these pages, but it doesn't work; a different tab is highlighted.  Sometimes it's another custom tab and sometimes it's the Home tab.  Here is the page:

 

 

<apex:page showHeader="true" sidebar="true" tabStyle="My_Reports__tab" title="My Reports" controller="UserReportController" id="MyReports" >
    <apex:sectionHeader subtitle="Your Reports"/>
    <apex:pageBlock rendered="{!OR(isPortalUser, isLeadAgent, isTheUser)}">
    
        <div style="margin: 2px; padding: 2px; width: 90%; background: url('{!$Resource.MyLogo}') no-repeat;">
            <div style="font-weight: bolder; font-size: larger; margin-left: 150px;">
            
            <apex:outputLink value="/apex/monthlyReport">Individual Organization Reports</apex:outputLink><br/>
            <apex:outputLink value="/apex/BatchReport">Coalition Report</apex:outputLink><br/>
            <apex:outputLink value="/apex/TransferVerification">Transfer Verification Report</apex:outputLink><br/>
            <apex:outputLink value="/apex/UnderConstruction">Summary Report</apex:outputLink><br/>
            <apex:outputLink value="/apex/UnderConstruction">Progress on Goals Report</apex:outputLink><br/>
            <br/><br/><br/><br/><br/>
            </div>
        </div>
    </apex:pageBlock>
    <apex:pageBlock rendered="{!AND(NOT(isPortalUser), NOT(isLeadAgent), NOT(isTheUser))}">
        <apex:outputText style="font-weight: bolder;font-size: largest;">You are not authorized to view the reports.</apex:outputText>
    </apex:pageBlock>
   <br/>
</apex:page>

 

 

I am trying to localize a date field in Visualforce and I can't apply the end-users locale. I know I can use the outputField component but I want to manipulate the positioning and output differently. So I am trying to use outputtext component. I am able to output it as I like, but I am not able to apply the end-users locale.

 

Here is a snippet of code:

 

 

<apex:page controller="controllertest" >
<apex:form>
 <apex:outputText value="The formatted time right now is: 
         {0,date, EEEEEEE, d MMM yyyy}">
       <apex:param value="{!d}" />
   </apex:outputText>

</apex:form>
</apex:page>

 

 

No matter what locale or language the user is logged in with, I get "The formatted time right now is: Wednesday, 27 Oct 2010".

 

Anyone know how I can apply locale to this VF snippet?

Hello,

 

I am developing a trigger that will give access to certain contact records that will meet some criteria. I need to update and insert a ContactShare object for the same. However I am getting a compilation error.

 

 

Error: Compile Error: Field is not writeable: ContactShare.ContactId at line 8 column 9

 

 

trigger Share_Contact_For_Account on Contact (after insert, after update) {

    for (Contact c : Trigger.new) {


        ContactShare cs = new ContactShare();

        cs.ContactId = c.Id;
        cs.ContactAccessLevel = 'Edit';


    }
}

 

 Thanks

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This should be simple, but I can't figure it out.

 

I have a repeated list of record ID's, and I want to link them all to the respective record, the same way a list view links the Name field to the record.

 

 

<apex:pageBlock>
        <apex:panelgroup >
            <apex:pageblocktable value="{!sRecords}" var="r" >
                <apex:column >
                    <apex:commandLink value="{!r.Id}"  action="{!linkToRecord}">//How do I pass r.Id to the controller method?                                        
                    </apex:commandLink> 
                </apex:column>
            </apex:pageblocktable>
        </apex:panelgroup>
    </apex:pageBlock>

 

public PageReference linkToRecord() {
      String recordId='001A000000P4ZYy';//How do I make this a variable based on the Id clicked?
      PageReference recordPage= new PageReference('/'+recordId);
      return recordPage;
    }

 

 

 

 

<apex:outputLabel style="">
              <apex:commandButton action="{!add}" value="add"/>
              <apex:commandButton value="Search" action="{!Searchs}" onclick="return SearchClick()"/>
              </apex:outputLabel>

 use css styles like this

 

 <table width="100%">
                  <tr>
                      <td align="center">
                          <apex:commandButton action="{!add}" value="add"/>
                          <apex:commandButton value="Search" action="{!Searchs}" onclick="return SearchClick()"/>
                      </td>
                  </tr>
              </table>

 thanks for your help!

 

 

 

Hello,

when im running the belo code as a system administrator its working fine. But while running the code as a standard platform user its giving me this error. "Id value is not valid for Topic__c standard controller”

Please help me solve this error.

 

my apex class is:

 

public class Topic {

 public Topic(ApexPages.StandardController ctrx)  
 
  { 
         c1=new Topic__c();
         m=new message__c();
        
  
   }
 

The page from which it was redirected:

 

<apex:page StandardController="Topic__c" extensions="Topic" >
<apex:form id="form"  >
<apex:pageBlock >
        <apex:pageBlockSection title="Topics First page"  >
        
             <apex:pageBlockTable value="{!emp}" var="item">

                    <apex:column value="{!item.name}"/>
                    <apex:column value="{!item.description__c}"/>
                    <apex:column headerValue="Action" style="white-space: nowrap">
                        <a href="/apex/post_page?id={!item.id}">Post Message</a>
                    </apex:column>

             </apex:pageBlockTable>
                  
        </apex:pageBlockSection>
    
</apex:pageBlock>
<apex:commandButton action="{!new1}" value="new" >
</apex:commandbutton>

</apex:form>
</apex:page>

 

The page to which it was redirected:-

 

<apex:page standardController="Topic__c" extensions="Topic" >
<apex:form >
   
    <apex:pageBlock >
     
        <apex:pageBlockSection title="New Post Page" columns="1" >
            <apex:outputField value="{!Topic__c.description__c}"/>

            <apex:pageBlockTable value="{!MessageList}" var="item">
                <apex:column value="{!item.text__c}"/>
            </apex:pageBlockTable>
           
            <apex:inputField value="{!m.text__c}"/>
           
            <apex:commandButton value="Save" action="{!save1}"/>
        
        </apex:pageBlockSection>
   
    </apex:pageBlock>


</apex:form>
 
</apex:page>

Hello everyone, I'm trying to expand the width of a column, so that it stretches out across the screen. Any idea how to fix my problem?

 

Here's the vf code used:

 

<apex:form >
 <apex:pageBlock id="quote">
  <apex:pageBlockSection title="Totals" collapsible="true" >
   <apex:pageBlockTable value="{!other.lis}" var="item" id="other" styleClass="totals-section" width="100%">   
    <apex:column styleClass="first"></apex:column>

  </apex:pageblocktable>

 </apex:pageblockSection>

 </apex:pageBlock>

</apex:form>

 

And the css code:

 

 <style type="text/css">
  .pbSubheader h3{
   color: #192F68;
  }
 
  .totals-section first{
  width:800px;
  }
 </style>

 

Any ideas? Answers appreciated

  • October 20, 2010
  • Like
  • 0

Hello,

 

I have an orderposition that is referenced in a quotationposition. I now want to reference fields in the according orderposition.

In my VF page I tried to reference the following:

...

       <apex:dataTable value="{!KV_Positionen}" var="KP" id="Table" styleClass="my_table">
            <apex:facet name="header"></apex:facet>
            <apex:column >
                <apex:facet name="header">Anzahl</apex:facet>
                <apex:Outputtext value="{!KP.Auftragspositionen__c.GenAnzVerp__c}"/>
            </apex:column>

...

 

Auftragspositionen__c (orderposition) is a lookup in KV_Positionen (quotationposition).

 

My controller looks like:

...

                        KV_Positionen = [select name, KVA__c, Artikel__c, Auftragsposition__c, Verkaufspreis__c,
                                                        MWSt_1__c, MWSt_2__c, KK_Preis__c, gesetzl_zuzahlung__c, wirtschaftl_zuzahlung__c
                                                        from KVA_Position__c where Auftragsposition__c = :Apos.Id];

...

public KVA_Position__c[] getKV_Positionen()
{
                system.debug ('KV_pos: ' + KV_Positionen);
                return KV_Positionen;
}

 

I always get the error

Invalid field Auftragspositionen__c for SObject KVA_Position__c

 

If I try it with Auftragspositionen__r I get also an error.

 

Thanks in advance

Harry

Hi,

i want to  create a custom action '{!toadd}' for customObject 'UserProfiles__c' in the vf page.

 

i hav written the following code:

 

/* visualforce page  */

<apex:page standardController="UserProfile__c" extensions="LeaveAppClass">
    <div align="center" style="font-family:forte;font-size:18pt;color:brown;background:wheat">
        <h1>Leave Application</h1>
    </div><hr/>
    <apex:form >
        fromadd :{!UserProfile__c.emailID__c}<br/>
        toadd :{!toadd}<br/>
        subject :<apex:inputtext id="subject" size="40"/><br/>
    </apex:form>
</apex:page>

 

/* Extension class LeaveAppClass */

public class LeaveAppClass
{   
    ApexPages.StandardController con;
    public LeaveAppclass(ApexPages.StandardController controller)
    { 
        con = controller;
    }
    public String toadd()
    { 
        String emailID;
        Userprofile__c ucon = [select emailID__c from Userprofile__c where Role__c =: 'HR'];
        hremailID = ucon.emailID__c;       
        return emailID;       
    }
}

 

I am getting an error as:

ErrorError: Unknown property 'UserProfile__cStandardController.toadd' 

 

what could be the problem. I am new Visualforce and apex....help me

I am having trouble displaying a simple hyperlink.  I have a custom object called "someobject".  it has a field called "some_url" of type Formula.  The formula is below.

 

 

HYPERLINK('http://www.google.com', 'google' , '_blank')

 

 

the field outputs "Text".

 

So i have a custom controller/visualforce page for someobject.  It has a public member var with an instance of someobject that gets referenced all over the page with no problems.  I try to add this:

 

 

<apex:outputText value="{!someobject.some_url__c}" />

 hoping to see a hyperlink that says "google".  Instead I get nothing.

 

Can someone lead me on the path here?  Much thanks.

 

I have been working on a custom pdf page with CSS for quite a while and have not been able to standardize spacing between text lines within a mult-line field (billing address). What do I need to change to add the uniform spacing? I have not moved my css into an external style sheet, though I plan to.

 

 

My challenge is with this portion of the page:

 

                <apex:outputField value="{!quote.BillingAddress__c}" styleClass=" header3" />
                <apex:outputField value="{!quote.Created_Date__c}" />
                <span style="margin-left:-176px; margin-top: 500px;">
                <apex:outputLabel value="">
                <apex:outputField value="{!quote.BillingAddress2__c}"/>
                </apex:outputLabel>
                                </span>
                <span style="float:left; margin-left:0px; margin-top:-15px;">
                <apex:outputField value="{!quote.ExpirationDate}"/>
                                </span>
                <span style="float:left; margin-left:-176px; margin-top:-15px; z-index:-8;">
                <apex:outputLabel value="">
                <apex:outputfield value="{!quote.BillingCountry}"/>
                </apex:outputLabel>
                </span>   

 

 

 

 

Here is the entire visualforce page. I am not including the apex controllers as they are not applicable for this question.

 

<apex:page standardController="Quote" extensions="dataTableCons" standardstylesheets="false" renderAs="pdf" showHeader="false">
<head>
<style>
body { font-family: Arial Unicode MS; font-size: 10 px; } 

h3 {
    display:block; width:637px; padding:0; background:#ADD8E6;
    font-size:12px; line-height:23px; text-align:left; font-weight:normal;
}
h4 {
    display:block; width:637px; padding:0; 
    font-size:10px; line-height:12px; text-align:left; font-weight:normal;
}
h5 {
    display:block; width:637px; padding:0; 
    font-size:8px; line-height:12px; text-align:right; font-weight:normal;
}

.header
{
 width: 367x;
 height: 5px;
 background-color: gray;
 color: White;
 font-size:8pt;
 text-align: left;
 padding-left: 5px;
}
.header1
{
 width: 15px;
 height: 5px;
 background-color: gray;
 color: White;
 font-size:8pt;
 text-align: right;
 padding-left: 10px;
}
.header2
{
 width: 65px;
 background-color: gray;
 height: 5px;
 color: White;
 font-size:8pt;
 text-align: right;
 padding: 5px;
}

.tabletop {
    display:block; width:630px; height:5px; 
    background:transparent url(images/top.gif) no-repeat scroll 0 0;
    margin:0 0 0 4px;
}
.tablebk {
    width:615px;
    background:transparent url(images/middle.gif) repeat-y scroll 0 0;
    margin:0 0 0 4px; padding:0 0 0 15px;
}
.tablebottom {
    display:block; width:630px; height:16px; 
    background:transparent url(images/bottom.gif) no-repeat scroll 0 0;
    margin:0 0 0 4px;
}

table {table-layout:fixed; border-collapse:collapse; border-spacing:0; }

th {
    color:#fff; 
    font-size:14px; line-height:10px;
    padding:5px 6px 8px;
    vertical-align:top;
}
td {
    
    font-size:10px; line-height:10px;
    padding:3px;
    vertical-align:top;
}
th.col1,
td.col1 {text-align:left;}
.odd td {background-color:#f2f7fa;}

td input {
    width:85px; height:22px;
    font-size:14px; line-height:16px; font-weight:bold; text-align:left;
    padding-top:3px;
    border:null;
}

tr:hover td {background-color:#599bbd;} /* hover state does not work in ie6 */

/* table1 */
.table1 th.col1 {width:176px; }
.table1 th.col2 {width:181px;}
.table1 th.col3 {width:173px;}
.table1 td {padding-bottom:5px;}
.table1 td.col3 {padding-top:6px; padding-left:19px;}

/* table2 */
.table2 th.col1 {width:176px;}
.table2 th.col2 {width:181px;}
.table2 th.col3 {width:173px;}

/* table3 */
.table3 th.col1 {width:128px;}
.table3 th.col2 {width:153px;}
.table3 th.col3 {width:130px;}
.table3 th.col4 {width:95px;}
.table3 td {padding-bottom:5px;}
.table3 td.col4 {padding-top:6px; padding-left:19px;}
/* END Table CSS */


</style>
</head>

    <apex:form id="theForm">  
       <apex:pageBlock tabStyle="account">
            <apex:pageMessages />
         <apex:image url="/resource/1272645408000/Key_Logo" width="20%" height="20%"/>
           <Table class="table">
           <apex:pageBlockSection title="Essential Information" columns="2"  showHeader="false">
                <apex:outputField value="{!quote.Opportunity.AccountId}" styleClass="line-height='133px'" />
                <apex:outputField value="{!quote.quotenumber}" />
                <apex:outputField value="{!quote.BillingAddress__c}" styleClass=" header3" />
                <apex:outputField value="{!quote.Created_Date__c}" />
                <span style="margin-left:-176px; margin-top: 500px;">
                <apex:outputLabel value="">
                <apex:outputField value="{!quote.BillingAddress2__c}"/>
                </apex:outputLabel>
                                </span>
                <span style="float:left; margin-left:0px; margin-top:-15px;">
                <apex:outputField value="{!quote.ExpirationDate}"/>
                                </span>
                <span style="float:left; margin-left:-176px; margin-top:-15px; z-index:-8;">
                <apex:outputLabel value="">
                <apex:outputfield value="{!quote.BillingCountry}"/>
                </apex:outputLabel>
                </span>                
             </apex:pageBlockSection>

            <apex:pageBlockSection title="Contact Info" showHeader="true" >
                <apex:outputField value="{!quote.contactid}"/>
                <apex:outputField value="{!quote.Phone}"/>
                <apex:outputField value="{!quote.email}"/>
                <apex:outputField value="{!quote.fax}"/>
             </apex:pageBlockSection>

            </Table>

       </apex:pageBlock>
       
       </apex:form>

    <apex:pageBlock >
    <apex:pageBlockSection columns="2">
      <apex:dataTable value="{!Quote.QuoteLineItems}" rowClasses="even,odd," var="line"  width="630">
        <apex:column style="text-align:right;" headerClass="header1" headerValue="Item">
        <apex:facet name="Item">Item</apex:facet>
        <apex:outputText value="{!line.Quote_Item_Number__c}"/>
        </apex:column>  

        <apex:column style="text-align:left;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;"
          headerClass="header" headerValue="Product">
        <apex:facet name="header">Product</apex:facet>
        <apex:outputText value="{!line.PriceBookentry.name}"/>
        </apex:column>        
        <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Quantity">
        <apex:facet name="header">Quantity</apex:facet>
        <apex:outputText value="{!line.Quantity}"/>
        </apex:column>
    <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Price Each">
        <apex:facet name="header">Price Each</apex:facet>
        <apex:outputText value="{!line.ListPrice}"/>
        </apex:column>
    <apex:column style="text-align:right;
            border-left-style:solid; border-left-color:black;
            border-left-width:.25px;" headerClass="header2" headerValue="Price Each">
        <apex:facet name="header">SubTotal</apex:facet>
        <apex:outputText value="{!line.Subtotal}"/>
        </apex:column>        
      </apex:dataTable>
      </apex:pageBlockSection>
   </apex:pageBlock>
  
        <apex:form >      
       <apex:pageBlock >
       <apex:pageBlockSection columns="2">
       <apex:inputhidden />
       <apex:inputhidden />
       <apex:inputhidden />
       <apex:outputField value="{!quote.Grand_Total__c}" style="h5" />
       </apex:pageBlockSection>

       </apex:pageBlock>
       <apex:pageBlock >
       <h4>
       This quotation is provided for budgetary planning purposes only. 
       This is not an official offer of sale, orders cannot be placed against this budget quotation. 
       Once project details have been fully defined, a final detailed quotation will be submitted.
       </h4>
       </apex:pageBlock> 
      </apex:form>

</apex:page>

 


Hello,

 

The standard save button in my visualforce page does not save any changes I made.  I'm assuming I have to build it into the controller, but I can not find any documentation on exactly how to do this. 

 

My page creates a list where I can multiple multple records at one time, but I'm unable to save them.  Thanks in advance for any help!

 

Here is my contoller and Visualforce code:


public with sharing class InvoicePagination {
    private final Invoice__c invo;  

    public InvoicePagination(
           ApexPages.StandardSetController controller)
    {
           this.invo = (Invoice__c)controller.getRecord();
    }    
    
    public ApexPages.StandardSetController invoiceRecords{
        get {
            if(invoiceRecords == null) {
                return new ApexPages.StandardSetController(
                         Database.getQueryLocator(
                [SELECT Id, Name, Status__c,Check_Number__c,
                sales_order_number__r.Customer_Charge_Name__r.Payer__c,
                sales_order_number__r.Customer_Charge_Name__r.KCC_Order__r.Ship_Date__c,
                sales_order_number__r.Customer_Charge_Name__r.Total_Customer_Charge__c,
                sales_order_number__r.Customer_Charge_Name__r.KCC_Order__r.Name
                    FROM Invoice__c WHERE status__c = 'Open'
                    ]));
            }
            return invoiceRecords;
        }
        private set;
    }
    
    ***********************************************Visualforce Page******************************************************

    
    
    public List<Invoice__c> getInvoicePagination() {
         return (List<Invoice__c>) invoiceRecords.getRecords();
    }     
}


<apex:page standardController="Invoice__c"
           recordSetVar="invoices"
           tabStyle="Invoice__c" sidebar="false" extensions="InvoicePagination">
  <apex:form >
    <apex:pageBlock >
    
      <apex:pageMessages />
      
      <apex:pageBlockButtons >
        <apex:commandButton value="Save"
                            action="{!save}"/>
      </apex:pageBlockButtons>
      
      <apex:pageBlockTable value="{!InvoicePagination}"
                           var="inv">
 <apex:column value="{!inv.sales_order_number__r.Customer_Charge_Name__r.Payer__c}"/>
  <apex:column value="{!inv.sales_order_number__r.Customer_Charge_Name__r.KCC_Order__r.Name}"/>
 <apex:column value="{!inv.sales_order_number__r.Customer_Charge_Name__r.KCC_Order__r.Ship_Date__c}"/>
        <apex:column value="{!inv.name}"/>
        <apex:column value="{!inv.sales_order_number__r.Customer_Charge_Name__r.Total_Customer_Charge__c}"/>

        
        <apex:column headerValue="Status">
 <apex:inputField value="{!inv.Status__c}"/>
        </apex:column>
        <apex:column headerValue="Check Number">
        <apex:inputField value="{!inv.Check_Number__c}"/>
 
        </apex:column>
        
      </apex:pageBlockTable>      
            
    </apex:pageBlock>
  </apex:form>
</apex:page>