• Shantanu Punekar 5
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Senior Software Engineer
  • Atos

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
Hello,

I found below formula to add 3 business days to current date, this excludes the weends.

CASE(MOD(TODAY()- DATE(1900, 1, 7), 7), 0, TODAY()+3, 1, TODAY()+3, 2, TODAY()+3,3, TODAY()+5, 4, TODAY()+5, 5, TODAY()+5, 6, TODAY()+4,null)

I need to modify this formula to add 10 / 15 + todays date, i'm unable to identify where exactly to change in the formula which will display TODAY() + 10 business days.

Please help,
Thanks in advance.
Getting this error tough everything is created as its stated.

User-added image

Completed:

User-added image
Unable to proceed further.
Hello all,

I have created below trigger and a test class for it, still its not covering the trigger. What needs to be changed in this test class?
Please help

Trigger:
trigger OppTask on Opportunity (after update) {
    List <Contact> conList = [SELECT ID,AccountID FROM Contact WHERE AccountId IN (SELECT AccountId FROM Opportunity WHERE Id IN :Trigger.new)];
    map<ID,Contact> accountIDWithContactMap = new map<ID,Contact>();
    for(Contact con : conList){
        accountIDWithContactMap.put(con.AccountID, con);
    }    
    for(Opportunity Opp : Trigger.new){
        if(Trigger.newMap.get(opp.Id).StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName == 'Closed Won' && accountIDWithContactMap.containsKey(Opp.AccountId)){
            Task T = new Task();
            T.WhatId = opp.Id;            
            T.OwnerId = opp.OwnerId;
            T.Subject = 'Call';
            T.Status = 'In Progress';
            T.IsReminderSet = TRUE;
            T.WhoId = accountIDWithContactMap.get(Opp.AccountId).ID;
            T.ReminderDateTime = DateTime.now().addHours(24);
            
            insert T;
    
        }
        
        
    }



Test Class:
@isTest

public class testOppTaskTrigger{
    static testMethod void ValidateOppTaskTrigger(){
    Test.startTest();
    Account testAcc = new Account (Name = 'Test Account');
    insert testAcc;
    
    User U = [SELECT ID, Name FROM User WHERE Profile.Name = 'System Administrator'];
    
    Opportunity testOpp = new Opportunity (Name = 'Test Name',
                                     OwnerId =U.Id,
                                     AccountId = testAcc.Id,
                                     StageName = 'Open',
                                     Amount = 50000.00,
                                     CloseDate = System.today()
                                     );
    
    insert testOpp;
    
    Opportunity testOpp2 = [SELECT Name, Id, StageName FROM Opportunity WHERE Id =: testOpp.Id];
                            if(testOpp2.StageName == 'Closed Won') {
                            update testOpp;
    
    Task testTask = new Task ( WhatId = testOpp2.Id,            
            OwnerId = testOpp2.OwnerId,
            Subject = 'Call',
            Status = 'In Progress',
            IsReminderSet = TRUE,
            ReminderDateTime = DateTime.now().addHours(24));                                
     
     
     insert testTask;
     Test.stopTest();
    }
    }

}
 
I completed the challenge, earning the Force.com basics and Date Modeling badges, however I did so under a different login than my Salesforce employee login. I was having trouble accessing the developer zone and created a seperate account for it. Can I have the badges under my developer edition login transferred to my normal Salesforce employee login and am I still qualified for the t-shirt giveaway?