• prateek jain
  • NEWBIE
  • 84 Points
  • Member since 2017

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
    Questions
  • 55
    Replies
Hi

I just recently started working with Big Objects. I sucessfully added my first BigObject to the sandbox, but as is most oftent the case in development, I need to modify one of the index fields.

the first error meesage I am getting is we change length of a text field in an index.
So I decided to leave the original text field as is and I add a new one with the required length. Now I am getting an error message saying that we can't modify an index. 

We are in development.... change is constant. If we cant modify an object regardless of type, then what is the object is the first place
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities
I want to create visual workflow to create multiple records for an object like below table.Can Anyone help it is urgent please

I want to create visual workflow to create multiple records for an object like below table.Can Anyone help it is urgent please
So, in my web-to-lead form code, I have an org id which is unique to my organization. But, can we add leads to multiple org using a single web-to-lead form? Does this mean that for every org, web-to-lead forms are unique? 
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
Hi 
I have scheduled scheduler class everyday at 1pm(through UI). It seems to be woeking in my staging sanbox. but when i see in the apex job . it is status as queued  and  it should have one staus at 1pm as completed if it was woring at 1 pm.  but as queued.
but i production i can see the status as failed and  staus detail as Scheduler: failed to execute scheduled job: jobId:456778999X class: common.apex.async.AsyncApexJobObject, reason: Apex CPU time limit exceeded.
My question  is It failed in production because cpu time exceeded but in staging why there isno staus as completed or failed but looks like it is working.

 
  • December 03, 2017
  • Like
  • 0
Hi Guys,

On Campagin objects i have 3 custom fields like 
open           :
contacted    :
progress     :

Now we need to get all leads which are associated to that campagin records.
Suppose, I have  marketing campagin, which contact 10 leads . in them 5 leads in open status,3 is in contacted and 2 is in progress.
So now on marketing campagin record, i need to be output as
open : 5
contacted : 3
progress : 2

Thanks for advance

 
Hello,
When executing a flow, I am getting a flow error on an opportunity record lookup. All the criteria are met but I'm still getting an error "Failed to find record". Can you please help us understand why this would be happening? 

User-added image

Thanks. 
Hi

I just recently started working with Big Objects. I sucessfully added my first BigObject to the sandbox, but as is most oftent the case in development, I need to modify one of the index fields.

the first error meesage I am getting is we change length of a text field in an index.
So I decided to leave the original text field as is and I add a new one with the required length. Now I am getting an error message saying that we can't modify an index. 

We are in development.... change is constant. If we cant modify an object regardless of type, then what is the object is the first place
Has anyone created a visualforce page that helps users manage tasks by priority? 
Example:
Section for Low Priority                                Section for Normal Priority                                                 Section for High Priority

Can this be done? 
Unable to configure an Apex Trigger/Code to update a field after insert. When the data of one field is integrated from the Website into the Salesforce Lead record, I neeed a trigger that will update the Region field from the data entered in the Country field.
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities
We have an Apex Trigger set up so that Intake Records generate and populate new Participant Records (Contacts) given certain criteria. Lately, the newly created Contact Records have been also overwriting other Contacts Records when generated, sometimes 3 or 4 at a time! Help?
  1. @isTest
  2. public class alu_Internship_ControllerTest{
  3.     
  4.     Id OppRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Internship Opportunity').getRecordTypeId();
  5.     
  6.     public static testMethod void testaluController(){
  7.         
  8.          Account testAccount = new Account();
  9.          testAccount.Name = 'Test Account' ;
  10.          insert testAccount;
  11.          
  12.          alu_Internship_Cycle__c ic = new alu_Internship_Cycle__c();
  13.          ic.Name = 'Test Cycle';
  14.          ic.Start_Date__c = System.Today();
  15.          ic.End_Date__c    = System.Today() + 60;
  16.          insert ic;
  17.          
  18.          Opportunity opp = new Opportunity();
  19.          opp.RecordTypeId = '0120Y000000QELh';
  20.          opp.Name = 'Test Opportunity';
  21.          opp.StageName = 'Under Discussion';
  22.          opp.CloseDate = System.Today();
  23.          opp.AccountId = testAccount.Id;
  24.          opp.Internship_Cycle__c = ic.Id;
  25.          opp.Number_of_Internships_Committed__c = 1;
  26.          opp.Opportunity_Countries__c = 'Algeria';
  27.          insert opp;
  28.          
  29.          PageReference pageRef = Page.alu_Internship_form;
  30.          Test.setCurrentPage(pageRef);
  31.            alu_Internship_Controller testIntCyc = new alu_Internship_Controller();
  32.          testIntCyc.doInsert();
  33.  
  34.                   
  35.     }
  36. }
  37. public class alu_Internship_Controller {
  38.     
  39.     Id OppRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Internship Opportunity').getRecordTypeId();
  40.     public final static String STAGE_NAME_UD = 'Under Discussion';
  41.     
  42.     public Opportunity opps {get;set;}
  43.     public string str {get;set;}
  44.     public string counName {get;set;}
  45.     public String oppdes {get; set;}
  46.     public String names {get; set;}
  47.     public string cycleName { get; set;}
  48.     public Id Idc {get; set;}
  49.     public string cmpweb { get; set;}
  50.     public string oppcitiesofOper{get;set;}
  51.     public string oppPotPro{get;set;}
  52.     public List<string> couName { get; set;}
  53.     public List<String> listOfCompany {get; set;}
  54.     public Map<Id,String> mapIdStr {get; set;} 
  55.     public Id Ids {get; set;}
  56.     public Id opIds {get; set;}
  57.     public String acc {get; set;}
  58.     public Decimal noOfPosition {get;set;}
  59.     
  60.     public alu_Internship_Controller() {
  61.         opps = new Opportunity();
  62.         opps.RecordTypeId = OppRecordTypeId;
  63.         
  64.         mapIdStr = new Map<Id,String>();
  65.         listOfCompany = new List<String>();
  66.         for(Account a: [SELECT Id, Name From Account]) {
  67.             mapIdStr.put(a.Id, a.Name);
  68.             listOfCompany.add(a.name);
  69.         }
  70.     } 
  71.     public list<SelectOption> listCycleName {
  72.         get{
  73.             list<SelectOption> listSO = new list<SelectOption>();
  74.             listSO.add(new SelectOption('', 'Select Internship Cycle'));
  75.             for (alu_Internship_Cycle__c cyc : [select Id, Name from alu_Internship_Cycle__c]) {
  76.                 if(cyc != null) {
  77.                     listSO.add(new SelectOption(cyc.Id, cyc.Name));
  78.                 }
  79.             }
  80.             return listSO;
  81.         }
  82.        set;
  83.     }
  84.     public List<SelectOption> getCountries() {
  85.  
  86.         List<SelectOption> options = new List<SelectOption>();
  87.         Schema.DescribeFieldResult fieldResult = Opportunity.Opportunity_Countries__c.getDescribe();
  88.         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();   
  89.         for( Schema.PicklistEntry f : ple) {
  90.             options.add(new SelectOption(f.getLabel(), f.getValue()));
  91.         }
  92.         return options;
  93.     }
  94.     public List<SelectOption> getStages() {
  95.  
  96.         List<SelectOption> options = new List<SelectOption>();
  97.         Schema.DescribeFieldResult fieldResult = Opportunity.StageName.getDescribe();
  98.         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
  99.         for(Schema.PicklistEntry f : ple){
  100.             options.add(new SelectOption(f.getLabel(), f.getValue()));
  101.         }
  102.         return options;
  103.     }
  104.     
  105.     // Logic for Save Button.
  106.     public PageReference doInsert() {
  107.        
  108.         // Storing Id and Acccount Name If acc contains same name.
  109.         Map<Id,String> mapString = new Map<Id,String>();    
  110.         for(Id tmp : mapIdStr.KeySet()) {
  111.             String name = mapIdStr.get(tmp);
  112.             if(acc.Contains(name)){
  113.                 mapString.put(tmp,acc);
  114.             }          
  115.         }
  116.         for(Id Accid: mapString.KeySet()){
  117.             Ids = Accid;
  118.         }
  119.         System.debug('Ids'+Ids);
  120.         
  121.         
  122.         // validation Logic Start
  123.         if (acc == ''){
  124.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Company Name'));
  125.         return null;
  126.         }
  127.         if (cmpweb == ''){
  128.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter an Company Website'));
  129.         return null;
  130.         }
  131.         if (cycleName == null){
  132.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter an Preffered Internship Cycle'));
  133.         return null;
  134.         }
  135.         if (noOfPosition == null){
  136.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Number of Position'));
  137.         return null;
  138.         }    
  139.              
  140.         // Iterating OpportunityId from List Of Opportunity
  141.         for(Opportunity opps : opportunitylists(Ids, cycleName)) {
  142.             opIds = opps.Id;
  143.         }
  144.         for(string s : couName) {
  145.             if(counName != null){
  146.                 counName= counName+';'+s;
  147.             }else{
  148.                 counName = s;
  149.             }            
  150.         }
  151.         if (counName == null){
  152.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Countries Operation'));
  153.         return null;
  154.         } 
  155.     
  156.         Account ac = new Account();        
  157.         if(opIds != null) {
  158.             Opportunity opp = new Opportunity();
  159.             opp.Id = opIds;
  160.             opp.Opportunity_Countries__c = '';
  161.             opp.Opportunity_Description__c = oppdes;
  162.             opp.AccountId = Ids;
  163.             opp.Internship_Cycle__c = cycleName;
  164.             opp.Number_of_Internships_Committed__c = noOfPosition;
  165.             opp.Opportunity_Countries__c = counName;
  166.             update opp;
  167.             system.debug('Opp Update'+ opp);
  168.             
  169.             ac.Id= opp.AccountId;
  170.             ac.Website = cmpweb;
  171.             update ac;
  172.             system.debug('ACC Update'+ ac);
  173.             
  174.         } else {
  175.             Opportunity opp = new Opportunity();
  176.             opp.RecordTypeId = OppRecordTypeId;
  177.             opp.name = '-UG Internship-';
  178.             opp.Opportunity_Description__c = oppdes;
  179.             opp.CloseDate = System.today();
  180.             opp.AccountId = Ids;
  181.             opp.StageName = STAGE_NAME_UD;
  182.             opp.Internship_Cycle__c = cycleName;
  183.             opp.Opportunity_Countries__c = counName;
  184.             opp.Number_of_Internships_Committed__c = noOfPosition;
  185.             insert opp;
  186.             system.debug('Opp Insert'+ opp);
  187.             
  188.             ac.Id= opp.AccountId;
  189.             ac.Website = cmpweb;
  190.             update ac; 
  191.             system.debug('ACC Update'+ ac);
  192.         }      
  193.         pagereference ref = new pagereference('/apex/alu_Internship_Thanks_Msg');
  194.         ref.setredirect(true);
  195.         return ref;
  196.     }  
  197.      
  198.     // getting list of Opportunity    
  199.     public List<Opportunity> opportunitylists (Id Ids, String cycleName) {
  200.         return [SELECT Id, AccountId, Internship_Cycle__c 
  201.                 FROM Opportunity 
  202.                 WHERE AccountId =:Ids 
  203.                 AND Internship_Cycle__c = : cycleName 
  204.                 AND Stagename=: STAGE_NAME_UD
  205.                 ];
  206.     }
  207. }
  208.  
Hello! I am looking for advice on if and how we can build some workflows in Salesforce to collect some information we need. We had some in place but they rarely fired as I believe that because of the nature of what we are trying to do, Salesforce was confused. Out of 700 instances, they only fired 120 times so I deleted them all and want to start new. I am open to suggestions and your thoughts as to if we can even accomplish our goals.
Here are the details:
I created a custom object called Legal Support, it is where the sales team must go anytime they need to request our legal teams assistance with contracts, amendments, terms, etc. Once they fill out the deals of the Legal Support Object, there is a custom button that submits the request over to our legal team so that they may work on the request. While each request is in legal, the request will move through a series of statuses I have listed below. The legal team will change the phase in the Legal Support object in Salesforce each time the request goes to a different status in their control.
  • Unassigned
  • Working
  • Waiting
  • Backlog
  • Blocked
  • Done
  • Lost

The statuses are not linear events as they do not have a natural directional progression. For example, a request may go from unassigned to working, then to waiting, then back to working, then into blocked and back to working, etc. This can happen many times and legal makes redline changed to documents for our clients and they go back and forth many times until an agreement is reached. Our legal team wants to track how long the request is in each status. That means the workflows would need to in essence remember every time a request went back to each status (which could be three, four, five times) and add the times together to give us a total time the request was in each status. The goal is to analyze how long each legal status takes for our deals, I have tried several variations of flows but nothing I know of works and I believe it’s because this is not a linear process and due to the fact that the status can be changed back to the same status many times on one request. As of now I simply have Salesforce timestamping when we enter and leave each stage and providing the time in the status. Easy and simple but not telling us what we want as we want the sum of all the times that request went into each status. As it is now, each time it goes back into that status it overwrites the fields and starts counting again.
 
I have exhausted all avenues and I think this is not possible, but wanted to ask those who are much smarter than I and have much more Salesforce experience. I am happy to provide more details if need be. Thank you!
 
public class contactSend {
 public set<Id> lstSelectedCons {get;set;}
 public Date dat {
  set;
  get;
 }
 public Date To {
  set;
  get;
 }
 public Boolean showCalendarField {
  get;
  set;
 }
 public Date calendarFieldVal {
  get;
  set;
 }
 public List < Contact > SelectedDc {
  set;
  get;
 }
 public List < WrapDummy > wdlist {
  set;
  get;
 }
 public List < WrapDummy > wdlist1 {
  set;
  get;
 }
 public List < WrapDummy > wdlist2 {
  set;
  get;
 }

 public transient List < Contact > ct {
  set;
  get;
 }
 public string selectedvalue {
  set;
  get;
 }
 public id DummyconId {
  set;
  get;
 }
 public Map < string, id > mMap {
  set;
  get;
 }
 public string dummymail {
  set;
  get;
 }
 public string result {
  set;
  get;
 }
 public String messageBody;
 public Integer totalSize {
  set;
  get;
 }
 public Integer totalPages {
  set;
  get;
 }
 public Set < String > Scon;
 public set < id > setIds;
 public string selectedDataType {
  set;
  get;
 }
 public List < contact > ContactsToShow {
  get;
  set;
 }
 public Integer counter = 0; //TO track the number of records parsed
 public Integer limitSize = 100; //Number of records to be displayed
 //Integer totalSize =0;

 //pagination Standard set
 /**public Apexpages.Standardsetcontroller con;
    
 public Map<Id,Decimal> quantityMap {set;get;}
 public Set<Id> SelectedPropertyIds {set;get;}
 public string ContextItem {set;get;}
 public string ContextItemValue {set;get;} **/
 public Boolean SelectedAllProperties {
  set;
  get;
 }

 //List to show the limited records on the page
 /**  public List<WrapDummy> ContactsToShow {get;set;}
   public List<wrapDummy> currentrecords {get;set;}
   Integer counter = 0;//TO track the number of records parsed
   Integer limitSize = 10;//Number of records to be displayed
   Integer totalSize {set;get;} //To Store the total number of records available

  **/
 public List < Dummy_Contact__c > dummylist {
  set;
  get;
 }

 Public List < Contact > conlist {
  set;
  get;
 }
 public List < Dummy_Contact__c > dclist {
   set;
   get;
  }
  // filter condition variables
 public List < SelectOption > options {
  get;
  set;
 }
 public List < SelectOption > operatorOptions {
  get;
  set;
 }
 public static string selectedOperatorOption {
  get;
  set;
 }
 public static string SelectedOption {
  get;
  set;
 }
 public string enteredText {
  get;
  set;
 }
 public Map < string, string > checkDataTypeMap {
  get;
  set;
 }
 public List < contact > lstContacts {
  get;
  set;
 }
 public transient Map < String, Schema.SObjectType > schemaMap = Schema.getGlobalDescribe();

 public contactSend() {

  options = new List < SelectOption > ();
  checkDataTypeMap = new Map < String, string > ();
  operatorOptions = new List < SelectOption > ();
  //To fetch the Contact fields by Describe call
  Selectoption sv = new SelectOption('--Please Select--', '--Please Select--');
  Options.add(sv);

  Map < String, Schema.SObjectField > ContactFieldsMap = SchemaMap.get('Contact').getDescribe().fields.getMap();
  for (Schema.SObjectField sField: ContactFieldsMap.Values()) {
   schema.describefieldresult fieldName = sfield.getDescribe();
   Schema.DisplayType fielddataType = sfield.getDescribe().getType();
   string fieldType = string.valueOf(fielddataType);
   SelectOption sp = new SelectOption(fieldName.getName(), fieldName.getName());
   checkDataTypeMap.put(fieldName.getName(), fieldType);
   options.add(sp);
   options.sort();
  }  
  //Add the filter conditons feteched from Custom settings to show in picklist
  SelectOption selOpt = new SelectOption('--Please Select--', '--Please Select--');
  operatorOptions.add(selOpt);

  List < CustomCondition1__c > filetConditions = CustomCondition1__c.getall().values();
  for (CustomCondition1__c Fcon: filetConditions) {
   SelectOption Fsp = new SelectOption(Fcon.Name, Fcon.Name);
   operatorOptions.add(Fsp);
   operatorOptions.sort();
  }
 }

 public PageReference createcon() {

  conlist = [SELECT id, LastName, AssistantName, AssistantPhone, Birthdate, Department, Description, Email, Fax, HomePhone, MailingAddress,
   MailingCity, MailingCountry, MailingPostalCode, MailingState, MailingStreet, MobilePhone, Name, OtherAddress, OtherCity,
   OtherCountry, OtherPhone, OtherPostalCode, OtherState, OtherStreet, Phone, Title,
       (SELECT id, email__c, Assistant_Name__c, Assistant_Phone__c, Birthdate__c, Contact__c,
        Department__c, Description__c, Fax__c, First_Name__c, Home_Phone__c, Mailing_City__c, Mailing_Country__c,
        Mailing_State_Province__c, Mailing_Street__c, Mailing_Zip_Postal_Code__c, Mobile_Phone__c,
        Other_City__c, Other_Country__c, Other_Phone__c, Other_State_Province__c, Other_Street__c,
        Other_Zip_Postal_Code__c, Phone__c, Title__c from Cons__r)
   From Contact where id in :lstSelectedCons limit 9999 
  ];

  list < Dummy_Contact__c > listDummyContactMain = new list < Dummy_Contact__c > ();
  list < Dummy_Contact__c > listDummyContactNew = new list < Dummy_Contact__c > ();

  for (Contact c: conlist) {
   if (c.Cons__r.size() == 0) {

    Dummy_Contact__c Dcobj = new Dummy_Contact__c();
    Dcobj.Name = c.LastName;
    Dcobj.Assistant_Name__c = c.AssistantName;
    Dcobj.Assistant_Phone__c = c.AssistantPhone;
    Dcobj.Birthdate__c = c.Birthdate;
    Dcobj.Description__c = c.Description;
    Dcobj.Department__c = c.Department;      
    Dcobj.Email__c = c.Email;
    Dcobj.Fax__c = c.Fax;
    Dcobj.Mailing_City__c = c.MailingCity;
    Dcobj.Mailing_Country__c = c.MailingCountry;
    Dcobj.Mailing_Zip_Postal_Code__c = c.MailingPostalCode;
    Dcobj.Mailing_State_Province__c = c.MailingState;
    Dcobj.Mailing_Street__c = c.MailingStreet;
    Dcobj.Other_City__c = c.OtherCity;
    Dcobj.Other_Country__c = c.OtherCountry;
    Dcobj.Other_Phone__c = c.OtherPhone;
    Dcobj.Other_Zip_Postal_Code__c = c.OtherPostalCode;
    Dcobj.Other_State_Province__c = c.OtherState;
    Dcobj.Other_Street__c = c.OtherStreet;
    Dcobj.Phone__c = c.Phone;
    Dcobj.Home_Phone__c = c.HomePhone;
    Dcobj.Mobile_Phone__c = c.MobilePhone;
    Dcobj.Title__c = c.Title;
    Dcobj.Contact__c = c.id;

    listDummyContactNew.add(Dcobj);

    //insert Dcobj;

   } else {
    listDummyContactMain.add(c.Cons__r[0]);
   }
  }
  if (!listDummyContactNew.isEmpty())
  try{
   insert listDummyContactNew;
   }
   catch(Exception e){
   system.debug(e.getMessage());
   }
  setIds = new set < id > ();
  listDummyContactMain.addAll(listDummyContactNew);

  for (Dummy_Contact__c dummy: listDummyContactMain) {
   String ids = '';
   ids += '\'';
   ids += String.valueOf(dummy.id);
   ids += '\'';
   //setIds.add(ids);
   setIds.add(dummy.id);
  }

  return null;
 }

 public pageReference getTeamMembers() {
  getslist();
  return null;
 }

 public List < SelectOption > getslist() {
  List < SelectOption > Slist = new List < SelectOption > ();
  Slist.add(new SelectOption('Not Contacted', 'Not Contacted'));
  Slist.add(new SelectOption('Contacted', 'Contacted'));
  Slist.add(new SelectOption('30 days', '30 days'));
  Slist.add(new SelectOption('60 days', '60 days'));
  Slist.add(new SelectOption('90 days', '90 days'));

  return Slist;
 }

 public pageReference Search() {
  ct = new List < contact > ();
  result = null;
  Date lastDate30 = System.today().addDays(-30);
  Date lastDate60 = System.today().addDays(-60);
  Date lastDate90 = System.today().addDays(-90);
  wdlist = new List < WrapDummy > ();
  wdlist1 = new List < WrapDummy > ();
  wdlist2 = new List < WrapDummy > ();

  string soql = 'SELECT id,LastName,AssistantName,AssistantPhone,Birthdate,Department,Description,Email,Fax,' + +
   'HomePhone,MailingAddress,MailingCity,MailingCountry,MailingPostalCode,MailingState,' + +
   'MailingStreet,MobilePhone,Name,firstname,OtherAddress,OtherCity,OtherCountry,OtherPhone,OtherPostalCode,' + +
   'OtherState,OtherStreet,Account.Name,LastModifiedDate,Phone,Title,Mail_Sent_Date__c,' + +
   '(SELECT Assistant_Name__c,Assistant_Phone__c,Birthdate__c,Contact__c,CreatedById,CreatedDate,Department__c,Description__c,Email__c,Fax__c,First_Name__c,Home_Phone__c,Id,IsDeleted,Mailing_City__c,Mailing_Country__c,Mailing_State_Province__c,Mailing_Street__c,Mailing_Zip_Postal_Code__c,Mobile_Phone__c,Name,Other_City__c,Other_Country__c,Other_Phone__c,Other_State_Province__c,Other_Street__c,Other_Zip_Postal_Code__c,OwnerId,Phone__c,Title__c from Cons__r) From Contact where   ';
  string whereConditions = '';

  string resultQuery = '';
  if (string.isNotBlank(SelectedOption)) {
   whereConditions = SelectedOption;
  }
  if (string.isNotBlank(selectedOperatorOption)) {
   if (selectedOperatorOption == 'Equal to') {
    selectedOperatorOption = '=';
   } else {
    if (selectedOperatorOption == 'Not equal to') {
     selectedOperatorOption = '!=';
    }
   }
   whereConditions = whereConditions + ' ' + selectedOperatorOption;
   system.debug('enteredText ************ ' + enteredText);
   if (string.isNotBlank(enteredText) || calendarFieldVal != null) {
    string selectedDataType = checkDataTypeMap.get(SelectedOption);
    if (selectedDataType == 'BOOLEAN') {
     whereConditions = whereConditions + ' ' + enteredText;
    }
    if (selectedDataType == 'STRING')
     whereConditions = whereConditions + ' ' + '\'' + enteredText + '\'';
    if (selectedDataType == 'DATE') {
     whereConditions = whereConditions + ' ' + calendarFieldVal;
    }
   }
   if (selectedvalue == 'Not Contacted') {
    if (selectedOperatorOption == 'Select Value' || enteredText == '') {
     resultQuery = soql + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c = null';
        system.debug('hello1 :'+resultQuery);
    } else {
     resultQuery = soql + whereConditions + ' AND  ' + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c = null';
        system.debug('hello2 :'+resultQuery);
    }
    ct = database.query(resultQuery + ' Limit 10000');
       system.debug('ct sixe is1  :'+ct);
   }
  }
  if (selectedvalue == 'Contacted') {
   if (selectedOperatorOption == '--Please Select--' || enteredText == '') {
    resultQuery = soql + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c != null';

   } else {
    resultQuery = soql + whereConditions + ' AND  ' + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c != null';
   }
   ct = database.query(resultQuery + ' Limit 10000');
      system.debug('ct sixe is2  :'+ct);
  } else if (selectedvalue == '30 days') {
   if (selectedOperatorOption == 'Select Value' || enteredText == '') {
    resultQuery = soql + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate30';

   } else {
    resultQuery = soql + whereConditions + ' AND  ' + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate30';
   }
   ct = database.query(resultQuery + ' Limit 10000');
      system.debug('ct sixe is3  :'+ct);
  } else if (selectedvalue == '60 days') {
   if (selectedOperatorOption == 'Select Value' || enteredText == '') {
    resultQuery = soql + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate60';

   } else {
    resultQuery = soql + whereConditions + ' AND  ' + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate60';
   }
   ct = database.query(resultQuery + ' Limit 10000');
    system.debug('ct sixe is4  :'+ct);
  } else if (selectedvalue == '90 days')
  {
       if (selectedOperatorOption == 'Select Value' || enteredText == '') {
        resultQuery = soql + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate90';
    
       } else {
        resultQuery = soql + whereConditions + ' AND  ' + 'LastModifiedDate >=:dat AND LastModifiedDate <=:to and Mail_Sent_Date__c < :lastDate90';
       }
       ct = database.query(resultQuery + ' Limit 10000');
        system.debug('ct sixe is5  :'+ct);
  }

  dummylist = new List < Dummy_Contact__c > ();
  if (!ct.isEmpty()) {
   for (Contact cf: ct) {       
    for (Dummy_Contact__c df: cf.Cons__r) {
     DummyconId = df.id;
     dummymail = df.email__c;
     dummylist.add(df);
    }
   }   
  }
     for (Contact dt: ct)
        wdlist.add(new WrapDummy(dt));
  totalSize = wdlist.size();
     system.debug('total size is :'+totalSize);
  if ((counter + limitSize) <= totalSize) {
   for (Integer i = 0; i < limitSize; i++) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  } else {
   for (Integer i = 0; i < totalSize; i++) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  }

  totalPages = Integer.valueOf(Math.ceil(totalSize / (Double) limitSize));
  return null;
 }

 public void beginning() {
system.debug('wdlist is :'+wdlist);
 
  wdlist1.clear();
  counter=0;
  if ((counter + limitSize) <= totalSize) {      
   for (Integer i = 0; i < limitSize; i++) {
       if(!wdlist.isEmpty()){
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
       }
   }
  } else {
   for (Integer i = 0; i < totalSize; i++) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  }
 }
 public void nextP() {


  if (selectedAllProperties)
   selectedAllProperties = true;


  else
   selectedAllProperties = false;

  wdlist1.clear();
  counter = counter + limitSize;

  if ((counter + limitSize) <= totalSize) {
   for (Integer i = counter; i < (counter + limitSize); i++) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  } else {
   for (Integer i = counter; i < totalSize; i++) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  }

 }
 public void previousP() {
  if (selectedAllProperties)
   selectedAllProperties = true;

  else
   selectedAllProperties = false;


  wdlist1.clear();
  counter = counter - limitSize;
  for (Integer i = counter; i < (counter + limitSize); i++) {
   if (!wdlist.isEmpty()) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  }

 }
 public void lastP() {

system.debug('wdlist is :'+wdlist);
  wdlist1.clear();
  if (math.mod(totalSize, limitSize) == 0)
   counter = limitSize * ((totalSize / limitSize) - 1);
  else if (math.mod(totalSize, limitSize) != 0)
   counter = limitSize * ((totalSize / limitSize));
system.debug('counter :'+counter);
     system.debug('totalSize :'+totalSize);
  for (Integer i = counter - 1; i < totalSize - 1; i++) {
   if (!wdlist.isEmpty()) {
    wdlist1.add(wdlist.get(i));
    wdlist2.add(wdlist.get(i));
   }
  }
 }
 public Boolean getDisableNext() {

  if ((counter + limitSize) >= totalSize)
   return true;
  else
   return false;
 }

 public Boolean getDisablePrevious() {

  if (counter == 0)
   return true;
  else
   return false;
 }
 public PageReference processselected() {
  Set < String > scon = new Set < String > ();
  lstSelectedCons = new set<Id>();
  SelectedDc = new List < Contact > ();
  set < Contact > ncts = new set < Contact > ();

  List < contact > updatecons = new List < Contact > ();
  if (!wdlist2.isEmpty()) {
   for (WrapDummy WrapDummyobj: wdlist2) {
    if (WrapDummyobj.selected == true) {
        lstSelectedCons.add(WrapDummyobj.Dcc.Id);
     SelectedDc.add(WrapDummyobj.Dcc);
     
     for (contact cts: SelectedDc) {
      cts.Mail_Sent_Date__c = Date.today();
      ncts.add(cts);
      // setids.add(cts.id);
    
     }
     //update ncts;                   
    }
   }

   if (!ncts.isEmpty()) {
    list < Contact > listNcts = new list < Contact > ();
    listNcts.addAll(ncts);
   }
   createcon();
  }
 // EmailTemplate templateId = [Select id from EmailTemplate where name = 'Sales: New Customer Email'];
  ContactUpdateURL__c mc = ContactUpdateURL__c.getall().values();
  string urlcode = mc.URLforContactUpdate__c;
  Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();

  if (SelectedDc.size() > 9) {
   for (contact c: SelectedDc) {
    scon.add(String.valueOf(c.id));
    system.debug(c.id);
    system.debug(c.cons__r);
     
    string cEmail = c.Email;
  
   }

   mailsend objmailsend = new mailsend();
   objmailsend.setIds = setIds;
   objmailsend.queryString = 'Select Assistant_Name__c,Assistant_Phone__c,Birthdate__c,Contact__c,CreatedById,CreatedDate,Department__c,Description__c,Email__c,Fax__c,First_Name__c,Home_Phone__c,Id,IsDeleted,Mailing_City__c,Mailing_Country__c,Mailing_State_Province__c,Mailing_Street__c,Mailing_Zip_Postal_Code__c,Mobile_Phone__c,Name,Other_City__c,Other_Country__c,Other_Phone__c,Other_State_Province__c,Other_Street__c,Other_Zip_Postal_Code__c,OwnerId,Phone__c,Title__c   From Dummy_Contact__c';

   Database.executeBatch(objmailsend);
   result = 'Sending Emails are under process';
   for (Contact cs: SelectedDc) {
    cs.Mail_Sent_Date__c = Date.today();
    updatecons.add(cs);
   }


  } else {
  system.debug('Email to send contact is : '+SelectedDc);
   for (contact c: SelectedDc) {

    scon.add(String.valueOf(c.id));
    string cEmail = c.Email;
       system.debug('be fore dummt contatc is : '+cEmail);
    for (Dummy_Contact__c dd: c.cons__r) {
        system.debug('dummt contatc is : '+dd);
     id DummyconId = dd.id;
     string dummyname = dd.name;
     string dummymail = dd.email__c;
     string dummytitle = dd.Title__c;
     string dummyphone = dd.phone__c;
     string dummymobile = dd.Mobile_Phone__c;
     string dummyfax = dd.fax__c;
     string dummymailingstreet = dd.Mailing_Street__c;
     string dummypostalcode = dd.Mailing_Zip_Postal_Code__c;
     string dummymailingcity = dd.Mailing_City__c;
     string dummystate = dd.Mailing_State_Province__c;
     string dummycountry = dd.Mailing_Country__c;
      
     
        
     message.toAddresses = new String[] {
      dummymail
     };
     
     message.setTargetObjectId(c.id);
     message.optOutPolicy = 'FILTER';
     message.subject = 'Touch Contact';
     messageBody = '<html><body>Dear ' + dummyname + ',<br><br> ' + +

      'I' + 'm currently updating my contact database and want to make sure I have your current data right.' + +

      'Could you have a quick look at below info? If you would like to change or update certain information, just click the ' + 'Update Now' + ' link on the bottom of the email and save your changes when done.<br> <br>' + +

      'Last Name:' + dummyname + '<br><br>' + +

      'Email:' + dummymail + '<br><br>' + +

      'Current company:' + +'<br><br>' + +

      'Title:' + dummytitle + '<br><br>' + +

      'Phone:' + dummyphone + '<br> <br>' + +

      'Mobile:' + dummymobile + '<br><br>' + +

      'Fax:' + dummyfax + '<br><br>' + +

      'Street:' + dummymailingstreet + '<br><br>' + +

      'Postalcode:' + dummypostalcode + '<br><br>' + +

      'City:' + dummymailingcity + '<br><br>' + +

      'State/Province:' + dummystate + '<br><br>' + +

      'Country:' + dummycountry + '<br><br><br>' + +

      '<a href="' + urlcode + DummyconId + '">Update Now</a>' + '<br><br><br>' + +

      'Many thanks in advance, ' + '<br>' + +


      '' + UserInfo.getlastname() + ' </html></body>';


     message.setHtmlBody(messageBody);
     message.setSaveAsActivity(false);
     Messaging.SingleEmailMessage[] messages = new List < Messaging.SingleEmailMessage > {
      message
     };
     Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
  system.debug('hello email :'+results);
     if (results[0].success) {
      c.Mail_Sent_Date__c = Date.today();
      updatecons.add(c);
      result = 'Email Sent';
     } else {
      string result = 'Email Not Sent';
     }
     break;
    }
   }

  }
  if(!updatecons.isEmpty())
  update updatecons;
  if (SelectedDc.isEmpty()) {
   ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Please Select value'));
   return null;
  }

  pageReference pr = new PageReference('/apex/ContactMassMail1');
  pr.setRedirect(true);
  return pr;
 }

 public class WrapDummy {
  public Contact Dcc {
   set;
   get;
  }
  public Boolean selected {
   set;
   get;
  }
  public Decimal quantity {
   set;
   get;
  }
  public WrapDummy(Contact dt) {
   Dcc = dt;
   selected = false;
   quantity = 0;
  }
 }
 public pageReference enableCalendarTextBox() {
  string selDataType = checkDataTypeMap.get(SelectedOption);
  if (selDataType == 'DATE') {
   showCalendarField = true;
  } else {
   showCalendarField = false;
  }
  return null;
 }
}
=====================vf ==================
<apex:page showHeader="true" sidebar="false" controller="contactSend"  docType="html-5.0" id="mypage"  tabStyle="Contact" >
   <style type = "text/css">
      .pbs{
      color: red;
      }
   </style>
        
   <apex:form id="fm"  style="color:blue;">
      <apex:pageBlock id="pb" >
         <apex:pageMessages ></apex:pageMessages>
         <apex:pageBlockSection collapsible="false" id="pbs" >
            <apex:outputLabel >Last Modified Date From</apex:outputLabel>
            <apex:input type="date" value="{!dat}"    />
            <apex:outputLabel >Last Modified Date To</apex:outputLabel>
            <apex:input type="date"  value="{!to}"  />
            <apex:outputLabel >Contact Last sent</apex:outputLabel>
            <apex:selectList value="{!selectedvalue}" multiselect="false" size="1">
               <apex:selectOptions value="{!Slist}"></apex:selectOptions>
            </apex:selectList>
         </apex:pageBlockSection>
         <apex:pageBlock id="filt">
            <apex:outputLabel value="Select Field"  />
            :   
            <apex:selectList value="{!SelectedOption}" size="1">
                <apex:selectOptions value="{!Options}"  />
                  <apex:actionSupport event="onchange"  action="{!enableCalendarTextBox}" reRender="calendarField"   />              
            </apex:selectList>
            <apex:selectList value="{!selectedOperatorOption}" size="1" >
               <apex:selectOptions value="{!operatorOptions}" >                  
               </apex:selectOptions>
            </apex:selectList>   
             
            <apex:outputPanel id="calendarField">                
               <apex:input type="date" value="{!calendarFieldVal}"  style="{!if(showCalendarField,'display:hidden;', 'display:none')}"   />
                <apex:inputText value="{!enteredText}" style="{!if(showCalendarField,'display:none;', 'display:hidden')}" />                
            </apex:outputPanel>            
         </apex:pageBlock>
         <div class="pbs"  >
            <apex:pageBlockButtons location="bottom" > 
               <div style="float:None;align:center;margin-left:20%;"> 
               <apex:commandButton value="Search" action="{!Search}" status="actStatusId1" style="background:powderblue; width:100px;" rerender="table1, pb2,fm,pb,pi">
                  <apex:actionsupport event="oncomplete" rerender=" pb1"/>
               </apex:commandButton>
               </div>
            </apex:pageBlockButtons>
         </div>
      </apex:pageBlock>
      <apex:pageBlock id="pb1" >
         <apex:actionStatus id="actStatusId1" startText=" Processing the stuff "  >
            <apex:facet name="start" >
               <img src="/img/loading.gif" />
            </apex:facet>
         </apex:actionStatus>
         
      
          
        <apex:pageBlock title="Contact Details" id="noRec" rendered="{! IF(wdlist1!= null && wdlist1.size ==0 , true, false)}" >
            <apex:outputPanel >
                <h1>No Records Found </h1>
            </apex:outputPanel>
            </apex:pageBlock>
               <apex:pageBlockTable value="{!wdlist1}" var="c" id="table1"   > 
            <apex:column >
                    <apex:facet name="header">
                        <apex:inputCheckbox value="{!selectedAllProperties}" onclick="selectAllCheckboxes(this)" rendered="{! IF(wdlist1!= null && wdlist1.size !=0 , true, false)}" />
                    </apex:facet> 
                    <apex:inputCheckbox value="{!c.selected}" styleClass="cbStyleClass" onclick="doCheckboxChange(this,'{!c.Dcc.Id}')" />
                </apex:column>
            <apex:column value="{!c.Dcc.Lastname}"/>
            <apex:column value="{!c.Dcc.Firstname}"/>
            <apex:column value="{!c.Dcc.Account.Name}"/>
            <apex:column value="{!c.Dcc.Email}"/>
            <apex:column value="{!c.Dcc.LastModifiedDate}"/>
         </apex:pageBlockTable>
         
       <apex:outputPanel rendered="{! IF(wdlist1!= null && wdlist1.size !=0 , true, false)}">
                <br/>
                <!-- count of selected items -->
                <apex:outputLabel value="Total Number of Records :{!totalSize } " />
            </apex:outputPanel>
              <br/> 
         
          <apex:outputPanel styleClass="center" rendered="{! IF(wdlist1!= null && wdlist1.size !=0 , true, false)}" id="button" >              
                         <apex:commandButton value="First" action="{!beginning}" disabled="{!DisablePrevious}"  />
                         <apex:commandButton value="Previous" action="{!previousP}" disabled="{!DisablePrevious}"    />
                         <apex:commandButton value="Next" action="{!nextP}" disabled="{!DisableNext}"  />
                         <apex:commandButton value="Last" action="{!lastP}" disabled="{!DisableNext}"    />                                 
          </apex:outputPanel>
        <apex:pageBlockButtons rendered="{!wdlist1!=null}"  id="myButtons"  >
          <div style="float:None;align:center;margin-left:20%;"> 
            <apex:actionStatus id="mySaveStatus1">
               <apex:facet name="stop">
                  <apex:commandButton value="Send Mail" action="{!processselected}" style="background:powderblue; width:100px;" reRender="pb2,pb" status="mySaveStatus1"/>
               </apex:facet>
               <apex:facet name="start">
                  <apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/>
               </apex:facet>
            </apex:actionStatus> 
           </div>    
         </apex:pageBlockButtons>
         
         
      </apex:pageBlock>
     
   </apex:form>
   
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
       
    //function to handle checkbox selection
    function doCheckboxChange(cb,itemId)
    {
        if(cb.selected==true){
            aSelectItem(itemId);
        }
        else{
            aDeselectItem(itemId);
        }        
    }    
    function selectAllCheckboxes(obj){
        $(".cbStyleClass").each(function(index, item){
            item.checked = obj.checked;
        });
        isSelectAllItem(obj.checked);
    }
    
    function updateTextChange(obj, itemId){
        
        updateQuantity(itemId, $(obj).val());
    }
    </script>
   </apex:page>

 
Best Practice : When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.

User-added image


      That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

Thanks #Copy_Steve Molis
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities