Activity Forums Salesforce® Discussions How to create Holiday object in test setup in test class in Salesforce?

  • MOHIT

    Member
    June 4, 2020 at 2:57 pm

    Holiday hol = new Holiday();
    hol.Name='Test holiday';
    hol.activitydate = System.Today();
    insert hol;

  • Aditya

    Member
    June 4, 2020 at 3:14 pm

    Hi,
    holiday holiDay = new holiday();
    holiDay.Name='test';
    holiDay.ActivityDate=Date.newInstance(2020, 05, 30);
    insert holiDay;
    List <Holiday> holidays = [Select Id From Holiday];
    system.debug('testHolidays---'+holidays);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos