Friday, 17 January 2014

Use Tab Color Dynamically on VF page from JS.





Hi guys,

I am writing this post because recently i used it and feel must share it,

Here I am creating a VF with some colored arrow on page (Created by using CSS) and color of arrows automatically changes according to the color and style of the Custom-Tab,

This requirement is mainly needed when you are creating a detail VF page

Now magic is to use arrow color same as the Tab color of your object.

I achieved this using Javascript and CSS,

Here is the VF page code:-


Screen Shots:


Now, i just changed Tab Style and color by following these steps:-

Setup -> Create -> Tabs -> Custom_Object__c

Here is the new Tab style and color:-


arrows and highlighted section color changes automatically.


Hope it will help u guys, Happy Coding....:)

Monday, 6 January 2014

Genrate Bar Codes from UPC or SKU by REST API.







Hi friends,

By this post I’ll show how to save Bar Code in Salesforce by using UPC code,

I call web service of third party which gives the image of Barcode (by using REST Api’s) and that image is Saved in the Notes and Attachment of Product.

Here the Sample code for same:-

Screen Shots:-







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.