Monday 23 December 2013

Add PDF VF-Page to Notes and Attachment from custom button and refresh current page.





Hi Friends,


In this post i m writing how to add the attachment to Note & Attachment of Salesforce.com from VF-Page which is rendered as “pdf” from detail page Custom button.

Here the Custom button code its of onclick java script behaviour:-

               window.showModalDialog('/apex/PDF_Page?id={!Lead.Id}','',"
           dialogWidth:800px;dialogHeight:500px; center:yes | no | 1 | 0 | on | off");
           location.reload(true);


Here i used two VF-Pages to avoid recursive calling of VF Page because I am saving Attachment of page to Notes and Attachment of same object.

Note:-
Remember not to call the method from  "PDF_Page_demo".

Happy Coding...:)

here the sceern shots:-



Tuesday 17 December 2013

Show Radio Button on the VF page


Hi Guys,

here the example to show the Radio buttons on the VF Page and toggle between them,

Controller Class And VF Page:-


this is the screen shot of the VF page.

Saturday 30 November 2013

Showing image in the ms-word document from vf page of Salesforce.





Hi guys,


I am writing this because one of my friend get stuck in this requirement, I am also get surprised why the image is not showing in the MS-Document,

then finally I got its solution.

Here the code for the VF-Page,

   <apex:page sidebar="false"
            showHeader="false"
            contentType="application/msword#Test.doc"
            cache="true">

<head>
                        <meta http-equiv="Content-Type" 
                               content="text/html;charset=UTF-8" />
</head>

<img src="Document_URL" />
    </apex:page>

--> Document_Url is the url of the your image uploaded in the Document object of Salesforce.
--> cache = "true" for IE.

Hope  it helps...
Happy Coding...

Thanks,
Anurag Jain.

Tuesday 26 November 2013

Shows Standard Salesforce Report Chart to Standard Salesforce Sidebar.





Hi guys,

   I’m writing this post because it may be the requirement of your clients and their is not direct way to show chart on Standard sidebar of salesforce.

This is actually the new type of requirement form one of my client, he wants to see the report chart on every page of its salesforce account, so solve it in this way to put chart on sidebar and show make visible the sidebar on every page.

Basically i opens an "iframe" on the html of Home Page Components.

So here the steps:
1.      Create a Report chart according to you requirements, make sure that this chart is of Tiny in size so that it can easily come in sidebar window.
2.      then go to Setup > Customize > Home > Home Page Components > Custom Components > New,
then choose the “HTML Area” then next and selects Narrow(Left) Column, click on show html check box on the right  corner and put the following code in it:

<iframe src="https://cs14.salesforce.com/Report_Id" scrolling="no" height="620px" width="150%" style="margin-top: -445px; margin-left: -70px;"/>
 
3.      Now add this component to the home page layout
(Note: make sure you assigned the page to the profile in the Home Page Layout.)
Now you can see that report chart is showing to the home page side bar as,

If you want to show it on every page then,
Go to Setup > Customize > User Interface > Sidebar
then true the “Show Custom Sidebar Components on All Pages” check box and save it,

That’s it, now the report chart is showing on every page of you Salesforce where sidebar is visible as:

Happy Coding…:)

Thanks,
Anurag Jain,