Posts

Showing posts from April, 2016

Some Useful Formula Fields

1) Get Week Day CASE(  MOD( DATEVALUE( CreatedDate ) - DATE( 1990, 1, 7 ), 7 ),  0, "Sunday",  1, "Monday",  2, "Tuesday",  3, "Wednesday",  4, "Thursday",  5, "Friday",  "Saturday"  ) 2) Get Month Year Based on PickList Values if(  ispickval(Status__c,'THIS_MONTH'),  (case(Month(Date__c),  1,"JAN",  2,"FEB",  3,"MARCH",  4,"APRIL",  5,"MAY",  6,"JUNE",  7,"JULY",  8,"AUG",  9,"SEP",  10,"OCT",  11,"NOV",  12,"DEC", " "  ) +'-'+ TEXT(year(Date__c))) ,  if(ispickval(Status__c,'NEXT_MONTH'),  (case(Month(Date__c) + 1 ,  1,"JAN",  2,"FEB",  3,"MARCH",  4,"APRIL",  5,"MAY",  6,"JUNE",  7,"JULY",  8,"AUG",  9,"SEP",  10,"OCT",

Deleted Selected multiple Row from Releated list using custom button

Image
Create a Custom button as a List Type Button and Execute JavaScript Code {!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} try {   var selectedRecords = {!GETRECORDIDS( $ObjectType.QuoteLineItem )};   if(selectedRecords.length < 1)     alert('Please Select at Least One Row !');   else   {     userConsent = confirm(selectedRecords.length + ' Record(s) will be Deleted. Continue ? ');     if(userConsent == true)     {       delResult = sforce.connection.deleteIds(selectedRecords);              var message = '';       var msgFailedReason = '<br/><h3>Failed Record(s)</h3><br/><div style="height: 300px;overflow-y: scroll;"><table style="border-collapse: collapse;">';       var passCount = 0, failCount = 0;       for(var i=0; i < delResult.length; i++){         if(delResult[i].getBoolean('success')){           passCount++;         }         else{           fai

Add and Delete Row functionality using wrapper class

Image
Page Code <apex:page controller="AddandDeleteController">     <apex:form >             <apex:pageBlock title="Account Records">         <apex:pageMessages ></apex:pageMessages>             <apex:pageBlockButtons location="top">                 <apex:commandButton value="Add Row" action="{!addRow}" reRender="table" immediate="true"/>             </apex:pageBlockButtons>                 <apex:pageBlockTable value="{!accountwrapperList}" var="page" id="table">                      <apex:column headerValue="Name">                         <apex:inputField value="{!page.account.name}"/>                     </apex:column>                     <apex:column headerValue="Phone">                         <apex:inputField value="{!page.account.Phone}" />        

Open Pop Up Box without using CSS

Image
Page Code <apex:page id="pg" controller="PopupScreenController">     <apex:form id="frm">         <apex:pageBlock title="PopUp" id="pb">             <apex:pagemessages id="msg"/>             <apex:commandButton value="Show Screen" onclick="opnePopup();" Oncomplete="refresh"/>                              <script type="text/javascript">                     var PopupBox;                     var strreason;                     var strcomment;                     PopupBox  = new SimpleDialog("test",false);                     PopupBox.createDialog();                     function opnePopup()                     {                         PopupBox.setTitle("PopUp Example");                         PopupBox.importContentNode(document.getElementById("{!$Component.PopupBox}"));                         PopupBox.sho