Wednesday, December 11, 2013

Message Dialogue Box / Splash Screen in Salesforce

Hello Friends,
I am back with a new logic for Salesforce developers. Lots of time our client / project manager requirements to display a Error message in a message dialogue box OR in a splash Screen.
I have figure out the simplest way to display message in dialogue box OR in a splash.

For Demo of Splash Screen / Dialogue Box-  
https://rajjha-developer-edition.ap1.force.com/apexontips/splashDemo

For this you are required some CSS that you can change according to your requirements. and 4 lines of code.
In a dialogue box you can display -
Error Message:  Custom OR ApexPages messages.
Button : apex buttons, HTML buttons etc.
and all of things that we are using on VFPages.

For this you need a CSS file that have to be stored in Static Resource, With the name  "splashCSS".
link for download the CSS file -
https://drive.google.com/file/d/0B4ctbLlHaa29Tl9URHl6Z2szQ0k/edit?usp=sharing

For the Splash Screen OR Dialogue box you can use this code -


<apex:page>
    <apex:form>
        <apex:stylesheet value="{!$Resource.splashCSS}"/>  <!-- CSS file that is stored in Static Resource. -->
        <Apex:outputPanel rendered="true">                 <!--- output panel for render the splash screen. TRUE= visible / FALSE = Hide  -->
            <apex:outputPanel styleClass="popupBackground" layout="block" />
            <apex:outputPanel styleClass="custPopup" layout="block" >    <!--- output panel for start you code which will display on splash screen. -->
                         This is demo of Splash Screen                 <!-- your code for splash screen -->
            </apex:outputPanel>
        </Apex:outputPanel>
     </apex:form>
</apex:page>

After alteration this code according to your need,  you will got the splash screen something like -