Monday, July 14, 2014

Removing The ViewState Coming in URL.

Hi  EveryOne,

   Basically when we click on Button we will perform some action in controller and we will redirect to same using ApexPages.CurrentPage().Whenever we use that functionality some case we will get viewState in the URL.So workaround it to remove the ViewState and to form actual URL agian we need to de below thing.

ViewState URL:

    public PageReference yourmethodname(){
       //Your Logic
       pageReference pref = ApexPages.currentPage(); 
       Id id = pref.getParameters().get('Id');
       pref .getParameters().clear();
       pref .getParameters().put('Id', id);  
       pref .setRedirect(true);
       return pref;  

OutPut :'recordId'

Saturday, June 28, 2014

Customer Care service: How To print Current page in sales force

Customer Care service: How To print Current page in sales force: Here how to print  current page in salesforce  salesforce can provide so many nationalities but some time our Customers Asking so critical r...

Friday, June 27, 2014

How to HIde and Show Password Value in Visual Force page using JQuery

  <html xmlns="">  
 <head id="Head1" runat="server">  
   <script type="text/javascript" src="">  
   <script type="text/javascript">  
     $(document).ready(function () {  
       $('#txtPwd').blur(function () {  
       $('#chkHidShw').change(function () {  
         var isChecked = $(this).prop('checked');  
         if (isChecked) {  
           $('#txthdnPwd').attr('readonly', 'readonly');  
         else {  
   <form id="form1" runat="server">  
     <input type="text" id="txtUser" runat="server" />  
     <br />  
     <input type="password" id="txtPwd" runat="server" />  
     <input type="text" id="txthdnPwd" style='display: none;' />  
     <br />  
     <input type="checkbox" id="chkHidShw" />&nbsp;Show Password  

Monday, June 16, 2014

Trigger Frameworks and Apex Trigger Best Practices

            I’ve read a lot of Apex Trigger code in my career. While I was consulting, I was able to see the good, the bad, and the ugly when it came to Trigger implementations. For the triggers that took a wrong turn at some point, the story was almost always the same. 
            The initial trigger was small, and served a single purpose. Over time, as new business requirements emerged, that once tiny trigger started growing and growing into a monstrosity. New functionality was routinely tacked on and technical debt began to accumulate. Now the logic was hard, if not impossible to follow. It was also becoming increasingly difficult to maintain because even the slightest change might mean rewriting the whole trigger from scratch. The tests were unreliable. Trigger logic was executing out of order and governor limits were getting hit left and right. I took a good look at not only the bad triggers that I saw, but the good ones as well. I started coming up with some best-practices that would help developers avoid some of these pitfalls. So before we get into Trigger Frameworks, which is the subject of this article, let’s first talk about some of the best practices developers should be aware of when it comes to trigger writing.Click Here For More