• SteveAnderson41
  • NEWBIE
  • 315 Points
  • Member since 2008

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 48
    Replies

I am new to SFDC and I would like to develop new VisualForce pages. Please cen you point me to a simple example?

 

Thanks

  • April 20, 2009
  • Like
  • 0

I need to perform an IF in a visualforce PDF template so I can break the quote into sections e.g. Product, Services, Ongoing costs etc ...

 

Any ideas how I can do this? 

 

<apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">

<!-- IF (opp.Qty==999) --> <tr> <td colspan="4"><h2>{!opp.Description}</h2></td> </tr> 

<!-- ELSE --> 

<tr> <td>{!opp.PriceBookEntry.Name}<br>{!opp.Description}</td> <td>{!ROUND(opp.Quantity,1)}</td> <td align="right">{!ROUND(opp.UnitPrice*1.00,2)}</td> <td align="right">{!ROUND(opp.TotalPrice*1.00,2)}</td> 

</tr>  

<!-- END IF --> 

</apex:repeat>  

Can anyone tell me how to access the current user's User fields within the VisualForce email?

 

I've tried:

 

{!user.Phone}

{!currentuser.Phone}

{!from.Phone}

{!sender.Phone}

 

and got nothing.

 

If this isn't possible, how do you make generic email templates?  I've got 15 people all sending emails using the same templates, so unique, user-based templates are out of the question.

 

Thanks!
Matt

What is wrong with my statement:

  Also All I want to do is drop the CurrencyISO from the field:

<apex:outputField value="{!SUBSTITUTE(TEXT(ROUND(item.Unit_Price__c, 0)), "GBP", "," )}" />

 

 

I need to render my page as a PDF, so I need to move my inline JS to a static resouce.  However, my JS references variables defined on the page.  So, how do I reference dynamic content in a static resource?

 

This page works:

<apex:page standardcontroller="Account" tabStyle="Account">
    <script type="text/javascript">

        var var1 = '{!Account.name}';       
        function testFunction() {document.write(var1);}
        testFunction();         
    </script>
</apex:page>

 

 

Same page rendered as PDF does not work, hence the need for a Static Resource:

<apex:page standardcontroller="Account" tabStyle="Account" renderAs="pdf">
    <script type="text/javascript">    
        var var1 = '{!Account.name}';       
        function testFunction() {document.write(var1);}
        testFunction();         
    </script>
</apex:page>

 

 

Test Static Resource code:

<script type="text/javascript">    
    var var1 = '{!Account.name}';   
    function testFunction()
    {       
        document.write(var1);
    }
    testFunction();         
</script>

 

New page code (does not work):

<apex:page standardcontroller="Account" tabStyle="Account">
    <script type="text/javascript" src="{!$Resource.test}" />
</apex:page>

 


 How do I define the Static Resource script var1 in my VF page?

 

Hi All,

 

 

When I use following code I see date in  "Wed Feb 11 00:00:00 GMT 2009" format

 

 

<apex:column width="10%"> <apex:facet name="header"> <apex:commandLink action="{!search}" value="Close Date" id="cmdSort2"> <apex:param value="o.CloseDate" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <apex:outputLabel value="{!opp.CloseDate}" /> </apex:column>

 

 

When I use 

<apex:column value="{!opp.CloseDate}" width="10%"/>

 

, it displays date in "mm/dd/yyyy" .

 

What I need to do to display date in "mm/dd/yyyy" format using outputLabel?

 

Are there any functions in Visualforce expression to support this..

 

 

 

Thanks,

Deepak

 

 

 

Hi,

 

Is there any way to reference a staticresource image from css that's been uploaded as a static resource?

 

 

Hi,

 

I have a requirement to export all the list of records that I display using datatable  to an excel.

I tried using the Contenttype attribute of page.

This works fine in firefox but throws the following error in IE.

 

 Internet Explorer cannot download "my visualforce page name" fromc.na6.visual.force.com.

 Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

 

 Please help.

 

 

Please help.

  • February 26, 2009
  • Like
  • 0

<apex:page standardController="Account" contentType="application/rtf#Pooja.rtf">

  Hello!  This page will be rendered as RTF, and will open, in Windows, in MS Word.

</apex:page>

 

The code does not work in IE. After 60 seconds it shows an alert that IE is unable to find the url and hence operation is aborted.

It works in Mozilla Firefox if we use the save file option. It doesn’t work with the open file option of Mozilla Firefox.

 

can someone help me?

 

 

 

OK.  I have spent hours trying to figure this out, so I thought I would post up and ask for some assistance.  To begin, I have not had any training other than Admin- no development training.  My company is not looking to spend money on training- so i need to figure it out myself.  Here is what I am doing-

I needed to create a dynamic section on an opportunity page.  I created it using VF and it looks like I want it, but I am having difficulties taking the next step.  I am using the standard opp controller on my new VF Opp page, and I added it to the layout of one of my page layouts using the new Spring 09 page layout tool.  When I do a Preview As..it comes up with a grey empty box where the VF form should be.  

 

Now I have been reading about Force ide and using Eclipse, but I think that is only used if I am not going to us the standardcontroller for opportunities.  

 

Am I missing anything?  I am going to keep trying to learn, but I would appreciate it if anyone can help me out.

I would like to know how to make it appear, because I think once I do that- the rest is pretty much done...

 

Thanks in advance for any assistance.

Message Edited by MarioC on 02-21-2009 04:11 PM
  • February 22, 2009
  • Like
  • 0

Hi,

 

Is it possible show/hide blocks based on the User Profile, using the parameter 'rendered'? More generally, do we have access to User profile info in a Visualforce page?

 

Thanks.

 

I am *trying* to work through the tutorials in the Force.com_Developer guide.

 

I have created the VisualForceExtension page, as described starting on page 379.

 

However, I can not get the dependant selectList to work. I've checked the Errata and I couldn't find any information to fix this problem.

 

If I do not remove

 

where pt.Department__c = :position.Department__c

 

from positionExtension.cls, the resulting selectList is empty. 

 

And, of course, if I remove it, the resulting selectList contains an entry for each Position Type record. 

 

I am guessing this selectList is empty because the Department defaults to "None"; moreover, that the problem isn't actually with the where clause, but the AJAX mechanism. 

 

I don't believe the page is being dynamically modified when Department is changed despite the lines which read: 

 

<apex:actionSupport

     event="onchange"

     action="{!resetPositionType}"  

     rerender="dependentPositionType"

     status="departmentStatus" />

 

 

I tried setting a default for the Department picklist, however the choice presented still defaulted to "None", so this didn't help to test the above theory that I'm stuck on the initial values populating the list.

 

On the theory that the AJAX may be incompatible with Firefox 3.5, I've also tried to view the page in several other browsers (Flock 2.5, Chrome 3.0, Safari 4.5, Opera 10, and IE7), however either I received the same results or SalesForce wouldn't even let me log in using the browser.

 

 

If anyone knows how to get the code in the book to work with modern browsers, please let me know.

 

If I need to use an older browser, please let me know that to.

 

Thanks,

 

-Brian.

I am new to SFDC and I would like to develop new VisualForce pages. Please cen you point me to a simple example?

 

Thanks

  • April 20, 2009
  • Like
  • 0

Hi,

 

I'm experimenting with putting my own Visualforce page in for Opportunity Line Items related list.

 

To start with, I have this:

 

<apex:page standardController="Opportunity"> <apex:pageBlock > <apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="oli"> <apex:column value="{!oli.Quantity}"/> <apex:column value="{!oli.ListPrice}"/> <apex:column value="{!oli.TotalPrice}"/> <apex:column value="{!oli.Sale_Type__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

I also want the first column "Action" in there as well, so that I can present the "Edit | Del" hyperlinks, slightly modified for my purposes, but still retaining the Salesforce.com look.

 

How do I put that into the markup above?  I get the feeling that it's not something I can easily put into a pageBlockTable.  If not, where (or how) do I put it in?

 

Also, my next problem is how to get the pageBlockButtons section in so that it refers to the OpportunityLineItems methods (whatever they actually are??? I can't seem to find standard controller methods anywhere in documentation).

 

Thanks! 

Message Edited by RDN_LHR on 04-09-2009 03:57 AM

I need to perform an IF in a visualforce PDF template so I can break the quote into sections e.g. Product, Services, Ongoing costs etc ...

 

Any ideas how I can do this? 

 

<apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">

<!-- IF (opp.Qty==999) --> <tr> <td colspan="4"><h2>{!opp.Description}</h2></td> </tr> 

<!-- ELSE --> 

<tr> <td>{!opp.PriceBookEntry.Name}<br>{!opp.Description}</td> <td>{!ROUND(opp.Quantity,1)}</td> <td align="right">{!ROUND(opp.UnitPrice*1.00,2)}</td> <td align="right">{!ROUND(opp.TotalPrice*1.00,2)}</td> 

</tr>  

<!-- END IF --> 

</apex:repeat>  

Hi guys, I am a new developer for SalesForce and am having some trouble finding documentation on some of the core functions.  I have found very basic documentation on the URLFOR function, but I can't find anything on the valid actions you can call from that function.  For instance, I have made a command button to close a case using the following button:

 

<apex:commandButton value="Close Case" action="{!URLFOR($Action.Case.CloseCase, Case.id, [retURL=URLFOR($Action.account.View, Case.account.Id)])}"/>

 

It works great and performs as expected, but where can I find a list of all the other possible actions? 

 

The main thing I am looking for in particular is the action for changing the owner of a case.  I tried to use the following command button:

 

<apex:commandButton value="Transfer Case" action="{!URLFOR($Action.Case.ChangeOwner, Case.Id, [retURL=URLFOR($Action.Case.View, Case.Id)])}"/>

 

But based on the error I am getting when I click it, this seems to be something for mass changing of owners.  Is there a different action to just change the owner of the case currently in context? 

 

Any help for this newbie would be greatly appreciated :)

Hi Anybody know fileupload feature in vf please give some link that will help me.
  • April 02, 2009
  • Like
  • 0

Can anyone tell me how to access the current user's User fields within the VisualForce email?

 

I've tried:

 

{!user.Phone}

{!currentuser.Phone}

{!from.Phone}

{!sender.Phone}

 

and got nothing.

 

If this isn't possible, how do you make generic email templates?  I've got 15 people all sending emails using the same templates, so unique, user-based templates are out of the question.

 

Thanks!
Matt

The following VF page does NOT display the square root sign in Internet Explorer. It works in Firefox.

 

It used to work before, now it doesn't!!

 

 

<apex:page > <apex:outputText value="&#x221a" escape="false" /> </apex:page>

 

I have verified that  IE is capable of displaying this (I wrote a small HTM), but VF generated HTML does not display this. The escape is supposed to escape the characters...

 

 

 

 

 

I have a PDF form with various checkbox, text and dropdown controls.


I need to populate some of these fields before view it to user and then the user needs to fill out the rest of the fields left empty.

 

Standard Visualforce "RenderAs" PDF does not seem to be the solution.

 

 

Has anyone had any exprience with the above problem?

I have the following code in both Sandbox and Production and for some reason the calendar pop up will not work on the close date field in production but it works fine in sandbox. Any ideas?

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar="false"> <apex:form > <apex:pageBlock > <apex:pageMessages /> <apex:pageBlock > <apex:panelGrid columns="2"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="opp_table"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> </apex:pageBlock> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!opportunities}" var="opp" id="opp_table"> <apex:column > <apex:facet name="header" ><b>Name</b></apex:facet> <apex:outputLink value="/{!opp.id}" > {!opp.name} </apex:outputLink> </apex:column> <apex:column headerValue="Stage"> <apex:inputField value="{!opp.stageName}"/> </apex:column> <apex:column headerValue="Close Date"> <apex:inputField value="{!opp.closeDate}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>

 

Can we use len() in VisualForce...

If yes anyone have an example cause I keep getting:

 Error: Incorrect parameter for function len(). Expected Text, received Number

 

I have the following:

 

<apex:page standardController="SFDC_520_Quote__c" extensions="salesQuotes" showHeader="false" sidebar="false" tabStyle="SFDC_520_Quote__c" renderAs="PDF"> <script> function formatCurrency(num) { num = num.toString().replace(/ \|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '' + num + '.' + cents); } </script> <style> h2 {color: #dddddd; font-size: 24px; } .teststyle {color: #ff3300;} </style> <apex:pageBlock> <apex:stylesheet value="{!URLFOR($Resource.pdfresource, 'styles.css')}"/>

 I need to call it here: How do I call it around UnitPrice???

 

<apex:pageBlockTable value="{!SFDC_520_Quote__c.quote_lines__r}" var="item" border="1" cellspacing="0" cellpadding="0" style="font-size:10px; font-family:courier;"> <apex:column headerValue="Unit Price"> <apex:outputText value="{!item.Unit_Price__c}"/> </apex:column> </apex:column> </apex:pageBlockTable>

 

 

 

 

 

What is wrong with my statement:

  Also All I want to do is drop the CurrencyISO from the field:

<apex:outputField value="{!SUBSTITUTE(TEXT(ROUND(item.Unit_Price__c, 0)), "GBP", "," )}" />

 

 

Hello,

I have created a web form that will allow users to insert new accounts and then attach new claims with them. So it inserts into the database the people account and then takes their unique id and attachs it to a new claim.

 

 

I now need to attach documents to each claim... is there a specific folder I can upload to, a temp folder then rename folder.

 

Does anyone here have any experience with this?

Hi,

I would like to ask if any expert know how to develop the Lookup button in the Visualforce Page. Thanks!

Best regards

 

  • February 26, 2009
  • Like
  • 0