• SaiVineeth Maddula
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi, I've created a approval process where it needs to be approved by multiple users when it meets the specific criteria. My  criteria is,

Income in Contact object < 50000 Needs User 1 Approval
If Income < 100000 Needs User 1, User 2 Approval
If Income > 100000 Needs User 1, User 2, User 3 Approval

I've tried creating approval steps but the approal request was going to all the users simultaneously.. Can someone help me resolve this...

Thanks in advance...
Hi,
I have  a requirement where I would like to add contacts to campaign record when status(Custom Field) of Contact is Closed Lost. I was stuck at adding contacts to campaign. Can someone help me acheive this since I am new to salesforce..

//Batch Class

global class AddContactsToCampaignBatch implements Database.Batchable<SObject>{
    global Database.QueryLocator start(Database.BatchableContext BC) {
        return Database.getQueryLocator([SELECT Id, Name 
                                         FROM Campaign 
                                         WHERE Name = 'Pipeline Campaign']);
    }
    global void execute(Database.BatchableContext BC, List<Contact> conList) {
        for(Contact con : [SELECT Id, Status__c 
                           FROM Contact]) {
                               if(con.Status__c == 'Closed Lost') {
                                  conList.add(con); 
                               }
                           }
        update conList;
    }
    global void finish(Database.BatchableContext BC) {
        
    }
}

Thanks in Advane....
Hi, I am trying to write a batch class which will delete the opportunities whose CloseDate is last month and update checkbox in related account.

//Batch Class

global class DeleteOppsBatch implements Database.Batchable<SObject> {
    List<Account> newList = new List<Account>();
    global Database.QueryLocator start (Database.BatchableContext BC) {
        return Database.getQueryLocator([Select Id, DeletedOpp__c, (SELECT Id, CloseDate FROM Opportunities WHERE CloseDate = LAST_N_DAYS:30) FROM Account]);
    }
    global void execute(Database.BatchableContext BC, List<Account> accList) {
        for(Account acc : accList) {
            acc.DeletedOpp__c = TRUE;
            newList.add(acc);
        }
        //update newList;
    }
    global void finish(Database.BatchableContext BC) {
        System.debug('listsize:'+newList.size());
        delete newList;
    }
}

I didn't understand why this class is not working. Can someone help me achieve this functionality.

Thanks in advance.
Hi,
I have  a requirement where I would like to add contacts to campaign record when status(Custom Field) of Contact is Closed Lost. I was stuck at adding contacts to campaign. Can someone help me acheive this since I am new to salesforce..

//Batch Class

global class AddContactsToCampaignBatch implements Database.Batchable<SObject>{
    global Database.QueryLocator start(Database.BatchableContext BC) {
        return Database.getQueryLocator([SELECT Id, Name 
                                         FROM Campaign 
                                         WHERE Name = 'Pipeline Campaign']);
    }
    global void execute(Database.BatchableContext BC, List<Contact> conList) {
        for(Contact con : [SELECT Id, Status__c 
                           FROM Contact]) {
                               if(con.Status__c == 'Closed Lost') {
                                  conList.add(con); 
                               }
                           }
        update conList;
    }
    global void finish(Database.BatchableContext BC) {
        
    }
}

Thanks in Advane....
Hi, I am trying to write a batch class which will delete the opportunities whose CloseDate is last month and update checkbox in related account.

//Batch Class

global class DeleteOppsBatch implements Database.Batchable<SObject> {
    List<Account> newList = new List<Account>();
    global Database.QueryLocator start (Database.BatchableContext BC) {
        return Database.getQueryLocator([Select Id, DeletedOpp__c, (SELECT Id, CloseDate FROM Opportunities WHERE CloseDate = LAST_N_DAYS:30) FROM Account]);
    }
    global void execute(Database.BatchableContext BC, List<Account> accList) {
        for(Account acc : accList) {
            acc.DeletedOpp__c = TRUE;
            newList.add(acc);
        }
        //update newList;
    }
    global void finish(Database.BatchableContext BC) {
        System.debug('listsize:'+newList.size());
        delete newList;
    }
}

I didn't understand why this class is not working. Can someone help me achieve this functionality.

Thanks in advance.