Skip to main content The last day to register for a Salesforce or Tableau exam is June 30th. Learn more about the new Salesforce certification experience coming July 21st.

Feed

Connect with fellow Trailblazers. Ask and answer questions to build your skills and network.

Hello 

i would like to know how i can identify SOQL queries in my apex classes & triggers that are performing poorly ?  using a lot of ressources ?   

How can i do that ? ( i have Event log monitoring) 

 

Regards 

Jérôme 

 

#Apex

1 answer
  1. Sushil Kumar (UKG) Forum Ambassador
    Today, 5:58 PM
0/9000

I created a report but it does not identify it when trying to collect the 500 for the assignment 

 

#Trailhead Challenges

3 answers
  1. Today, 5:58 PM

    Hi @Rita Fuentes

     

    I am from the Trailhead Help Team. Can you please confirm if you're still seeing an issue? If yes, please help us with the Trailhead module and share the URL of the unit along with the error screenshot if possible.

     

    Thank you!

    ++TrailheadHelpFollowUp

0/9000

I'm writing the test class but I'm unable to deploy to my org to run the tests. It's telling me that my date values are unexpected tokens and when I try to deploy, it tells me that the methods I'm calling from the provided VerifyDate class are invalid in my test class. Any Advice? I'm new to writing APEX and trying to learn development to increase my skillset. 

 

 Here's my test class for trying to get the 100% coverage the challenge asks for:

@isTest

private class TestVerifyDate {

@isTest

static void checkDateWithin30() {

// checking CheckDates method

date datewithin30 = VerifyDate.CheckDates(2025-03-08, 2025-03-20);

system.assertEquals(2025-03-20, datewithin30);

}

@isTest

static void checkDateNotWithin30() {

//checking CheckDates method for return end of month

date datewithin30 = VerifyDate.CheckDates(2025-03-08, 2025-04-20);

system.assertEquals(2025-03-31, datewithin30);

}

@isTest

static void checkDateMath(){

//check DateWithin30Days method for returning true

date DateTrue = VerifyDate.DateWithin30Days(2025-03-08, 2025-03-20);

system.AssertEquals(true, DateTrue);

}

@isTest

static void checkDateMath2(){

//check DateWithin30Days method for returning false, too far in future

date DateFalse = VerifyDate.DateWithin30Days (2025-03-08, 2025-04-20);

system.assertEquals(false, DateFalse);

}

@isTest

static void checkDateMath3(){

// check DateWithin30Days method for returning false, too far in past

date DateFalse2 = verifyDate.DateWithin30Days (2025-03-08, 2025-02-20);

system.AssertEquals(false, DateFalse2);

}

@isTest

static void checkEndofMonth(){

//checking method for calling end of month date

date EndofMonth = VerifyDate.SetEndOfMonthDate(2025-03-08);

system.assertEquals(2025-03-31, EndofMonth);

}

}

Here is the Class provided by the challenge that I'm writing the test for:

public class VerifyDate {

//method to handle potential checks against two dates

public static Date CheckDates(Date date1, Date date2) {

//if date2 is within the next 30 days of date1, use date2. Otherwise use the end of the month

if(DateWithin30Days(date1,date2)) {

return date2;

} else {

return SetEndOfMonthDate(date1);

}

}

//method to check if date2 is within the next 30 days of date1

private static Boolean DateWithin30Days(Date date1, Date date2) {

//check for date2 being in the past

if( date2 < date1) { return false; }

//check that date2 is within (>=) 30 days of date1

Date date30Days = date1.addDays(30); //create a date 30 days away from date1

if( date2 >= date30Days ) { return false; }

else { return true; }

}

//method to return the end of the month of a given date

private static Date SetEndOfMonthDate(Date date1) {

Integer totalDays = Date.daysInMonth(date1.year(), date1.month());

Date lastDay = Date.newInstance(date1.year(), date1.month(), totalDays);

return lastDay;

}

}

 

#Trailhead Challenges  #Salesforce Developer

 

#Trailhead  #Salesforce Admin  #Apex

1 answer
  1. Today, 5:58 PM

    Disregard question. I found the answer and fixed it with the following test class that got successful test and passed the challenge:

    @isTest

    private class TestVerifyDate {

    @isTest

    static void checkDateWithin30() {

    // checking CheckDates method

    date datewithin30 = VerifyDate.CheckDates(date.valueOf('2025-03-08'), date.valueOf('2025-03-20'));

    system.assertEquals(date.valueOf('2025-03-20'), datewithin30);

    }

    @isTest

    static void checkDateNotWithin30() {

    //checking CheckDates method for return end of month

    date datewithin30 = VerifyDate.CheckDates(date.valueOf('2025-03-08'), date.valueOf('2025-04-20'));

    system.assertEquals(date.valueOf('2025-03-31'), datewithin30);

    }

    }

0/9000
3 answers
  1. Today, 5:53 PM

    HI @KETHANA Elavarthi

     

    I am from the Trailhead Help Team. Can you please confirm if you're still seeing an issue? If yes, please help us with the Trailhead module and share the URL of the unit along with the error screenshot if possible.

     

    Thank you!

    ++TrailheadHelpFollowUp

0/9000

Hi I have triple checked enabled requirements, instructions etc.  Agent user is  EinsteinServiceAgent User . I deleted and recreated the Agent but still receiving "Unfortunately, I wasn't able to make the booking. Would you like to speak to a representative for further assistance?" all other actions work except for the booking.  Please see attached.  Thanks!    

10 answers
  1. Today, 5:50 PM

    HI @Sherry Bushman

     

    I am from the Trailhead help team. We see that you have completed the 'Quick Start: Build a Service Agent with Agentforce' Project. kindly share the solution that helped you resolve the issue or please make sure to mark the response which helped you to resolve your query as 'Best Answer' so that it might help the fellow Trailblazer's who are facing the similar issue.

     

     Thank you! 

     

0/9000
3 answers
  1. Today, 5:49 PM

    Hi @KETHANA Elavarthi

     

     

    I am from the Trailhead Help Team. Can you please confirm if you're still seeing an issue? If yes, please help us with the Trailhead module and share the URL of the unit along with the error screenshot if possible. 

     

    Thank you! 

    ++TrailheadHelpFollowUp 

0/9000
5 answers
  1. Today, 5:48 PM

    HI @Delia Guo

     

    I am from the Trailhead Help Team. Can you please confirm if you're still seeing an issue? If Yes, please let us know so that we can go ahead and create a case on behalf of you and can assist accordingly. 

      

    Thank you!

    ++TrailheadHelpFollowUp

0/9000

I am executing the project Connect Data Cloud to Agentforce and Prompt Builder > Bring External Data into the Contact Page Layout. In the step updates the Lightning record page for Contact, I am encountering the following error: "We had trouble processing the request. We've reported the problem to Customer Support with error ID: undefined."

 

#Trailhead Challenges  #Agentforce

3 answers
  1. Today, 5:46 PM

    HI @sinara farias

     

    I am from the Trailhead Help Team.  Could you please try again in the new playground. 

     

    Please navigate to the module, and you should be able to create a new playground org.

     

    If you still see an older playground org connected, please follow the below steps to create a new org.

     

    - Login to your trailhead account.

    - Now go to 'https://trailhead.salesforce.com/users/profiles/orgs' in a new tab.

    - Click on Create Playground & click 'Create'.

    - As soon as the playground gets created, refresh your page and you should be able to click Disconnect next to the Data Cloud org (Starting with epic..)

     

    Thank you!

0/9000
2 answers
  1. Today, 5:44 PM

    No I missed the deadline but I have completed it now. Any chances it can be reinstated?

0/9000