Posts

Showing posts from December 24, 2014

Batch Class and Dynamic Create Email Template

global  class batchClasAndSendDynamicEmailTemplate implements Database.Batchable<Sobject> {     set<Id> suid= new set<Id>();     set<id> sweekplanid = new set<id>();     map<id,user> mapManager = new map<id,user>();     Map<ID,List<Weekly_Plan__c>> mapUserIdToAWPList = new Map<Id,List<Weekly_Plan__c>>();     Map<ID,String> mapUserIdToManagerEmail = new Map<Id,String>();      Map<ID,String> mapManagerIdTomanager = new Map<Id,String>();      list<string> lstEmail = new list<string>();     string tempBody = '';     List<Weekly_Plan__c> listPJPWeeklyUpdate = new List<Weekly_Plan__c>();          global Database.Querylocator start(Database.Batchablecontext BC)     {         return Database.getQueryLocator([Sel...

Dynamic SOQL Query

String qString = 'Select Id , Name , FirstName , LastName , Account.Name , Kips_Designation__c , Kips_Relationship__c , Birthdate , Kips_Date_of_Anniversary__c , Kips_Feast_Date__c , Kips_Annual_Gift__c From Contact ';                  qString+= ' where Account.Name like \'%' + AccountName+ '%\'';                             if(objGift.kips_Type__c !=null && objGift.kips_Type__c !='')         {             if(objGift.kips_Type__c == 'School')             {                 //qString+= ' and Account.RecordType.Name like \'%' + objGift.kips_Type__c+ '%\'';                      qString+= ' and Account.RecordType.Name  =  \'' + objGift.kips_Type__c+ '\'';     ...

On Custom Button VF page Open in new Tab

{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")} var accId="{!Account.Id}"; window.open("/apex/vfpageName?id="+ accId ,"mywindow");