Play Games

Search This Blog

Thursday, June 19, 2014

How to set line numbers in eclipse?

In order to set line numbers in eclipse
go to window --> preferences --> click General --> click Editors --> click Text Editors








  


Now in the Text Editors window, make the checkbox of Show line numbers to true.

Then click Apply button and then ok button.

Thats it..

Now you will be able to see line numbers as shown below. 


Thursday, June 12, 2014

How to display image in word document?


step 1 :First upload the image to document.

Procedure: click on documents tab,then click new.Enter the details and upload the image.

Note:Make sure Externally available image checkbox is clicked.
step 2:now create the visualforce page with the following code.

<apex:page contentType="application/msword#Test.doc">
<head>
</head>
<body>
  This is your new Page
<apex:image url="https://c.ap1.content.force.com/servlet/servlet.ImageServer?id=01590000003w0sx&oid=00D90000000j4R8
 &lastMod=1399273218000" width="50" height="50" />
</body>
</apex:page>


note: To get image url,follow the steps

step 1:open the document where you uploaded the image.
step 2:Right click on the image icon and then copy image location.

Replace url of <apex:image> with the above copied image url.


When you run the visualforce page, the ouptut will be as follows.


Wednesday, June 11, 2014

How to get salesforce Webinars and articles ?

At first open the url " https://developer.salesforce.com/content/type/Webinar?language=en " in any browser.

The webpage will look like this.


Here We can find all webinars and articles related to salesforce.

Filters are also present to filter webinars or articles.
For example we can filter webinars or articles based on category and also we can filter based on year.


Enjoy the webinars or articles which you like.

How to get salesforce online training videos?


At first open the url " https://help.salesforce.com/hthome?err=1&siteLang=en_US.In " in
 any browser.

The webpage will look like this.
Now scroll the page down.You can find online training in Training section as highlighted
in the image below.
Go through the videos and Enjoy....


How to display standard list view functionality in visualforce page?

To display listviews ,we have <apex:listviews> component.

syntax: <apex:ListViews type="Account" /> where type indicates The Salesforce object
 for which list views are displayed.

For example to display account listviews in visualforce page,
first create a visualforce page with the following code

<apex:page standardController="Account" >
<form>
<apex:ListViews type="account" />
</form>
</apex:page>

when we run the above visualforce page the output will look like this


Thursday, June 5, 2014

How to do mathematical functions in visualforce page?


Generally we do mathematical operations in apex classes and get that values to visualforce page.

But there may be situations where we need to do mathematical operations in visualforce page itself.For example if we have professional edition,then we cannot create apex classes.
At that time we can do mathematical operations in vf page itself in the following way.

For example to find sum of list of values.first we create <apex:variabe> and
then inside <apex:repeat> tag we perform the mathematical calculations.

The below example will find the sum of a field(quantity) of all opportunitylineitems
associated with opportunity.

<apex:page standardController="opportunity" >
<apex:form >
     
          <apex:repeat value="{!opportunity}" var="qList">
          <apex:variable value="{!0}" var="salesprice"/>
          <apex:variable value="{!0}" var="sumofquantity"/>
             <apex:repeat value="{!qList.opportunitylineitems}" var="QlItem">
                 <apex:variable value="{!salesprice +  if(QlItem.Unitprice!= null,QlItem.Unitprice,0)}" var="salesprice"/>
                 <apex:variable value="{!sumofquantity +  if(QlItem.Quantity!= null,QlItem.Quantity,0)}" var="sumofquantity"/>
                 <apex:outputLabel >Total Quantity</apex:outputLabel><apex:outputLabel value="{!sumofquantity}" title="Total"/>  <br />  
                 <apex:outputLabel >Total Sales Price</apex:outputLabel><apex:outputLabel value="{!salesprice}" title="Total1"/>  <br />  
                 <apex:outputLabel value="MC= {!if(QlItem.Unitprice == 0,0,round(QlItem.Unitprice/QlItem.Quantity,2))}"/>
             </apex:repeat>

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

 When we run the page by giving opportunity id,the output  will be as follows