Monday, 30 January 2017

Is there a way to restrict the buttons on a standard page to be displayed top or bottom only ?


Generally we will be displaying buttons on both bottom and top of the page using below code

Code
<apex:page standardController="lead" extensions="appointmentcontroller">
  <apex:form>
      <apex:pageBlock> 
          <h1>Congratulations</h1>
          This is your new Page
           <apex:pageBlockButtons>
                   <apex:commandButton action="{!saveAndCongrat}" value="Save" reRender="test"/>
                   <apex:commandButton value="Cancel" action="{!cancelredirect}" />         
           </apex:pageBlockButtons>
       </apex:pageBlock>
   </apex:form>
</apex:page>

Output



What if you want to display button only on top or only on bottom ? then change the above code to below format by adding location attribute where you can specify top, bottom, or both - it defaults to both in pageBlockButtons

Code
<apex:page standardController="lead" extensions="appointmentcontroller">
  <apex:form>
      <apex:pageBlock> 
          <h1>Congratulations</h1>
          This is your new Page
           <apex:pageBlockButtons location="bottom">
                   <apex:commandButton action="{!saveAndCongrat}" value="Save" reRender="test"/>
                   <apex:commandButton value="Cancel" action="{!cancelredirect}" />         
           </apex:pageBlockButtons>
       </apex:pageBlock>
   </apex:form>
</apex:page>

Output


Monday, 23 January 2017





Want to avoid standard validation rules(like required fields)  in Visualforce page when cancel button is clicked ?



By adding attribute "immediate = true " in apex:commandbutton you can avoid standard validation rules in visualforce page.

Please find below sample code 

<apex:commandButton value="Click Me" immediate="true" action="{!selectedval}" rerender="table1" />







Friday, 20 January 2017


Having a problem with hiding Div while body onloading ? It shows for few seconds before being hidden ?



For solving above problem use below style code in the Div tag

<div style="display:none">
 ----Your Code---- 
</div>












StyleClass does not work with apex:commandButton Salesforce ?


Below is the code for CSS to change button styles
<apex:page >
        <style type="text/css">
                    .myClass {
                             color:white;
                             background-color:#00CC00;
                     }
         </style>
          <apex:commandButton styleClass="myClass" value="Save" action="{!someAction}">
</apex:page>

If above CSS is not reflecting to your button then change the CSS by adding Important to CSS
like below

<style type="text/css">
        .myClass{
                    color:white !important;
                    background:#00CC00 !important;
         }
</style>
 

Wednesday, 11 January 2017





Steps of Creating Domain in Salesforce


Below steps need to be followed in order to create domain in salesforce.

Step 1. Click on Setup
Step 2. Select My Domain under Domain Management 
Step 3. Enter Domain name ( should be unique ) like below

and Click Check Availability button 
If Domain Name is available then it shows Available message like below

                          

Step 4 . Now click on Register Domain button.

Wait for Some time while Registering process is done you will receive mail once it is completed it will show like below

                          


Step 5 :  Click on Login to test it .

Step 6: Click on Deploy to users to assign.






Unable to view lightning component tab in Salesforce ?


For viewing lighting component tab in salesforce first we need to create domain in salesforce org.



Now go and check you will be able to view lighting component section under tab section 


Tools for Lightning Web Component Development

 Below are the tools required for Web Component Development 1. Chrome Browser (Prefered) You can download it from Google 2. Visual Studio Co...