Skip to main content 欢迎参加 3 月 5 日至 6 日在旧金山举行的 TDX AI 代理时代开发者大会,或通过 Salesforce+ 参与。立即注册

#Trailhead Challenges2,454 人正在讨论

Hands-on challenges are the “secret sauce” of Trailhead. Before searching for solutions to superbadge challenges, review the Salesforce Certification Program Agreement and Policies.

Challenge Not yet complete... here's what's wrong:

We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

 

Not able to complete the challenge in the  Multi-Factor Authentication and Single Sign-On Settings Superbadge Unit

6 个回答
  1. 2023年12月22日 18:04

    I had the same error message for the Multi-Factor Authentication and Single Sign-On Settings Superbadge Unit. I thought I might have done something incorrectly with the installation of my Developer Edition org, so I created a second org. It didn't work either.

     

    I opened a case with Trailhead Help, but they weren't able to help. Their reply:

     

    "After reviewing your case, I believe that there are no platform issues or bugs associated with this superbadge. The Trailhead Help team is unable to share solutions or hints or debug any incorrect configuration or code."

     

    I've completed five other Superbadges for the Admin Super Set, and all have worked fine. I decided to start on a different Superbadge and I completed it with no issue. Hopefully this one will be fixed by the time I circle back around.

0/9000
13 个回答
  1. 2024年10月9日 22:59

    Chrissandra Jones (Progressive Security Group)

     

    Based on the SOP Knowldege 

    Contact Management: Cumulus Cloud Confectioners’ best practice for contacts that have left a company is to update the customer status to ’No Longer at the Company’ and create a new record with the updated information. Additionally, upon creating a new record for the departed contact, it’s essential to generate a case to ensure seamless tracking of any follow-up actions or communications required with the new contact or associated accounts. This helps maintain comprehensive records and facilitates efficient customer relationship management.

     

    We can mark the existing Candice Fluffington record status with 'No longer at Company'. Then create a new contact record with all infromation provided in the step then create a case from the new contact. 

     

    I passed challenge 2 by doing the above steps.

    Chrissandra Jones (Progressive Security Group) Based on the SOP Knowldege Contact Management: Cumulus Cloud Confectioners’ best practice for contacts that have left a company is to update the customer

0/9000

I am unable to complete this Trailhead Module: Get Hands-On with an Iterable Variable in For Loops, because I keep getting this error message: "The constructor MyIterable should accept parameter of type List<String>."

 

Here's my MyIterable Class with its constructor accepting the correct type of parameter:

 

public class MyIterable implements Iterable<String> {    private List<String> strings;    public MyIterable(List<String> strList) {        strings = strList;        strings.iterator();    }    public Iterator<String> iterator() {      return strings.iterator();   }}

 

#Trailhead Challenges

7 个回答
  1. 2024年12月12日 22:28

    Hi @Edward Dalton,

    • You need to assign strings (In constructor, It should be strings not strList) to strings class variable. Use this keyword.
    • You should replace strings = strList; with this.strings = strings;
    • In constructor remove strings.iterator();

    Code should be like this -

    public class MyIterable implements Iterable<String> {

    private List<String> strings;

    public MyIterable(List<String> strings) {

    this.strings = strings;

    }

    public Iterator<String> iterator() {

    return strings.iterator();

    }

    }

0/9000

I am trying to complete my Winter 25 Platform Developer I maintenance, and keep getting the following error when trying to complete the Challenge.

"Challenge not yet complete in Brave Moose Playground

We can’t find The Annotation @IsTest for method ‘testIterableForLoop’. "

 

I have tried to correct this multiple times by creating a new playground, but the same error persists.  As you can see below the @IsTest annotation is in my code below:

@IsTest

public class MyIterableTest {

@IsTest

    public static void testIterableForLoop () {

        List <String> strings = new List<String> {'Hello', 'World'};      

            MyIterable myIterable = new MyIterable(strings);

        for (String str: myIterable)

        {

            System.debug(str);

        }  

    }

}

 

Any help and Insight would be appreciated

16 个回答
  1. 2024年12月23日 16:09

    Working with Support, they were able to resolve the issue.  If you get this issue, I suggest opening a salesforce case, as I had to create a user for them in order for it to be resolved.  

0/9000
3 个回答
  1. 2月16日 04:37

    The output is as followed, indicating that everything ran ok. We even see the records in the output. But the submitting the challenge gives the message above. 

    Here is the output:  

    23:33:04.368 Starting Execute Anonymous Apex

     

    Compiled successfully.

    Executed successfully.

     

    63.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DATA_ACCESS,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,FINER;WAVE,INFO;WORKFLOW,INFO

    Execute Anonymous: System.debug(HouseService.getRecords());

    23:33:03.66 (66946038)|USER_INFO|[EXTERNAL]|005aj00000D1CxJ|mechelle@agentforce.com|(GMT-05:00) Eastern Standard Time (America/New_York)|GMT-05:00

    23:33:03.66 (66967285)|EXECUTION_STARTED

    23:33:03.66 (66986440)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex

    23:33:03.66 (67176946)|HEAP_ALLOCATE|[93]|Bytes:3

    23:33:03.66 (67216788)|HEAP_ALLOCATE|[98]|Bytes:152

    23:33:03.66 (67230580)|HEAP_ALLOCATE|[415]|Bytes:408

    23:33:03.66 (67240789)|HEAP_ALLOCATE|[428]|Bytes:408

    23:33:03.66 (67249108)|HEAP_ALLOCATE|[536]|Bytes:48

    23:33:03.66 (67269260)|HEAP_ALLOCATE|[247]|Bytes:6

    23:33:03.66 (67285951)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:1

    23:33:03.66 (67378038)|STATEMENT_EXECUTE|[1]

    23:33:03.66 (67379334)|STATEMENT_EXECUTE|[1]

    23:33:03.66 (67413047)|HEAP_ALLOCATE|[68]|Bytes:5

    23:33:03.66 (67431591)|HEAP_ALLOCATE|[74]|Bytes:5

    23:33:03.66 (67436538)|HEAP_ALLOCATE|[82]|Bytes:7

    23:33:03.66 (67450826)|SYSTEM_MODE_ENTER|false

    23:33:03.66 (67471808)|HEAP_ALLOCATE|[1]|Bytes:5

    23:33:03.66 (78913695)|HEAP_ALLOCATE|[1]|Bytes:1

    23:33:03.66 (78967200)|METHOD_ENTRY|[1]|01paj00000CTjXV|HouseService.HouseService()

    23:33:03.66 (78973030)|STATEMENT_EXECUTE|[1]

    23:33:03.66 (78979377)|STATEMENT_EXECUTE|[1]

    23:33:03.66 (78992392)|HEAP_ALLOCATE|[1]|Bytes:5

    23:33:03.66 (79008627)|METHOD_EXIT|[1]|HouseService

    23:33:03.66 (79049367)|METHOD_ENTRY|[1]|01paj00000CTjXV|HouseService.getRecords()

    23:33:03.66 (79152688)|HEAP_ALLOCATE|[4]|Bytes:5

    23:33:03.66 (79156207)|STATEMENT_EXECUTE|[3]

    23:33:03.66 (79157225)|STATEMENT_EXECUTE|[4]

    23:33:03.66 (79158040)|STATEMENT_EXECUTE|[4]

    23:33:03.66 (79158803)|STATEMENT_EXECUTE|[6]

    23:33:03.66 (79161977)|HEAP_ALLOCATE|[6]|Bytes:129

    23:33:03.66 (79179704)|HEAP_ALLOCATE|[6]|Bytes:4

    23:33:03.66 (88897722)|SOQL_EXECUTE_BEGIN|[6]|Aggregations:0|SELECT Id, Name, Address__c, State__c, City__c, Zip__c FROM House__c WITH USER_MODE ORDER BY CreatedDate ASC NULLS FIRST LIMIT 10

    23:33:03.66 (99095540)|SOQL_EXECUTE_END|[6]|Rows:5

    23:33:03.66 (99125109)|HEAP_ALLOCATE|[6]|Bytes:24

    23:33:03.66 (99167247)|HEAP_ALLOCATE|[6]|Bytes:663

    23:33:03.66 (99218271)|HEAP_ALLOCATE|[6]|Bytes:24

    23:33:03.66 (99237336)|VARIABLE_SCOPE_BEGIN|[6]|lstHouses|List<House__c>|true|false

    23:33:03.66 (99308282)|VARIABLE_ASSIGNMENT|[6]|lstHouses|[{"Id":"a00aj00000e2YmXAAU","Name":"Stunning Victorian","Address__c":"18 Henry St","State__c":"MA","City__c":"Cambridge","Zip__c":"01742"},{"Id":"a00aj00000e2YmYAAU","Name":"Ultimate Sophisticat (3 more) ...","Address__c":"24 Pearl St","State__c":"MA","City__c":"Cambridge","Zip__c":"02420"},{"Id":"a00aj00000e2YmZAAU","Name":"Modern City Living C (5 more) ...","Address__c":"72 Francis st","State__c":"MA","City__c":"Boston","Zip__c":"02420"},{"Id":"a00aj00000e2YmaAAE","Name":"Stunning Colonial","Address__c":"32 Prince st","State__c":"MA","City__c":"Cambridge","Zip__c":"02420"},{"Id":"a00aj00000e2YmbAAE","Name":"Waterfront in the Ci (2 more) ...","Address__c":"110 Baxter Street","State__c":"MA","City__c":"Boston","Zip__c":"02420"}]|0xd14f101

    23:33:03.66 (99318415)|STATEMENT_EXECUTE|[19]

    23:33:03.66 (99334012)|METHOD_EXIT|[1]|01paj00000CTjXV|HouseService.getRecords()

    23:33:03.66 (99343708)|SYSTEM_MODE_EXIT|false

    23:33:03.66 (99599042)|USER_DEBUG|[1]|DEBUG|(House__c:{Id=a00aj00000e2YmXAAU, Name=Stunning Victorian, Address__c=18 Henry St, State__c=MA, City__c=Cambridge, Zip__c=01742}, House__c:{Id=a00aj00000e2YmYAAU, Name=Ultimate Sophistication, Address__c=24 Pearl St, State__c=MA, City__c=Cambridge, Zip__c=02420}, House__c:{Id=a00aj00000e2YmZAAU, Name=Modern City Living Change, Address__c=72 Francis st, State__c=MA, City__c=Boston, Zip__c=02420}, House__c:{Id=a00aj00000e2YmaAAE, Name=Stunning Colonial, Address__c=32 Prince st, State__c=MA, City__c=Cambridge, Zip__c=02420}, House__c:{Id=a00aj00000e2YmbAAE, Name=Waterfront in the City, Address__c=110 Baxter Street, State__c=MA, City__c=Boston, Zip__c=02420})

    23:33:03.99 (99716600)|CUMULATIVE_LIMIT_USAGE

    23:33:03.99 (99716600)|LIMIT_USAGE_FOR_NS|(default)|

      Number of SOQL queries: 1 out of 100

      Number of query rows: 5 out of 50000

      Number of SOSL queries: 0 out of 20

      Number of DML statements: 0 out of 150

      Number of Publish Immediate DML: 0 out of 150

      Number of DML rows: 0 out of 10000

      Maximum CPU time: 0 out of 10000

      Maximum heap size: 0 out of 6000000

      Number of callouts: 0 out of 100

      Number of Email Invocations: 0 out of 10

      Number of future calls: 0 out of 50

      Number of queueable jobs added to the queue: 0 out of 50

      Number of Mobile Apex push calls: 0 out of 10

     

    23:33:03.99 (99716600)|CUMULATIVE_LIMIT_USAGE_END

     

    23:33:03.66 (99792081)|CODE_UNIT_FINISHED|execute_anonymous_apex

    23:33:03.66 (99802544)|EXECUTION_FINISHED

     

    23:33:04.803 ended Execute Anonymous Apex

0/9000

Hello Everyone, I am trying to complete my  DevWinter25 certification. I am facing an issue. I have completed the challenge in the Developer console, and it showed both strings as outputs( "Hello" ," World"). I am still getting prompt message saying that " We can't find the debug log with the string ‘Hello’.

 

 

I have tried multiple times by re-lauching the org, try doing again as new class, Run new test. I am still unsucessful. Is there anyone else facing this issue? Please, share if there is way to resolve this issue. please. Waiting to hear from you soon!

 

#Trailhead Challenges  #Certifications

4 个回答
  1. 1月15日 19:10

    Hi, @Kim Pat

     

    Try to use this code:

    Apex Class:

    public class MyIterable implements Iterable<String> {

    Private List<String> strings;

    // Constructor to initilize the list of strings

    public MyIterable(List<String> strings)

    {

    this.strings = strings;

    }

    // Implementing the iterator method

    public Iterator<String> iterator(){

    return strings.iterator();

    }

    }

    Test Class:

    @IsTest

    public class MyIterableTest {

    @IsTest

    static void testIterableForLoop(){

    // Create a list of strings

    List<String> strings = new List<String> {'Hello', 'World'};

    // Create an Instance of MyIterable

    MyIterable myIterable = new MyIterable(strings);

    // Use a for loop to iterate over the MyIterable instance

    for(String str: myIterable)

    {

    //Print each string to the debug log

    System.debug(str);

    }

    }

    }

    after saving Apex Class and Test Class click "Run Test".Hi, Try to use this code:Apex Class:public class MyIterable implements Iterable<String> { Private List<String> strings; // Constructor to initilize the list of strings public MyIterable(List<String> s

    Sincerely, 

    Mykhailo Vdovychenko 

    Bringing Cloud Excellence with IBVCLOUD OÜ

0/9000
Challenge Description:

 

Use DML to insert multiple records into a Salesforce database

 

Acme Inc. has opened three new locations in Texas. Acme needs to insert the new accounts into its database. Create a class and one method that creates three new accounts and adds them to the database.

  • Create a public Apex class named AccountHandler
  • Add a public static method to the class:

    • Name: insertAccount
  • Include a parameter for the number of new accounts:

    • Data type: integer
  • Create a list of Account records:

    • List name: addAccounts
  • Use a while loop to add three new Accounts to the list, where n is a value that is incremented by 1 during each iteration of the loop:

    • Name: Acme Inc n
    • AccountNumber: A000n
  • Hint: You did something like this when you created three new Tea Factory stores.
  • Write one DML statement that inserts all three records into the database at one time
  • Run your insertAccount method.

 

Error Message:

 

We can't find code that creates an 'addAccounts' list, adds three accounts to the 'addAccounts' list, and then inserts the 'addAccounts' list.

 

Code:

 

 

public class AccountHandler {

public static void insertAccount(Integer numAccts) {

List<Account> addAccounts = new List<Account>();

Integer counter = 1;

while(counter <= 3) {

Account a = new Account();

a.Name = 'Acme Inc ' + counter;

a.AccountNumber = 'A000' + counter;

addAccounts.add(a);

counter++;

}

if(addAccounts.size() > 0) {

Database.insert(addAccounts);

}

}

}

What am I doing wrong?

 

 
35 个回答
  1. 2019年8月13日 18:56
    This worked for me. 

     

    public class AccountHandler {

     

        public static void insertAccount(Integer numberofAccounts){

     

            Integer n = 1;

     

            List<Account> addAccounts=new List<Account>();

     

            while(n <= numberofAccounts){

     

                

     

              

     

                Account tempaccount=new Account();

     

                tempaccount.Name='Acme Inc '+ n;

     

                tempaccount.AccountNumber='A000'+ n;

     

                addAccounts.add(tempaccount);

     

                

     

                n=n+1;

     

            }

     

            insert addAccounts;

     

            

     

        }

     

    }
0/9000
4 个回答
  1. 2月6日 13:10

    Hello @R Pious Wilfred Nicholas

    Try below code and it should work.

    public class PropertyUtility{

    public static void newListedProperties(){

    List<Property__c> newPropList = [Select Name,Days_On_Market__c,Broker__r.Email__c from Property__c where Days_On_Market__c < 31];

    for(Property__c p : newPropList){

    string propEmail = p.Name +':'+ p.Broker__r.Email__c ;

    system.debug(propEmail);

    }

    }

    }

    Hope above information was helpful. 

    https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4LilSAF

0/9000

This is my code snippet and im still getting the  error mentioned: 

 

public class MyIterable implements Iterable<String> {

private List<String> strings;

public MyIterable(List<String> strings) {

this.strings = strings;

}

public Iterator<String> iterator() {

return strings.iterator();

}

}

#Trailhead Challenges

3 个回答
  1. 1月30日 04:29

    Hi , 

     

    I had similar issues with the renew. 

     

    here's what happened.....the culprit was whitespace in my case.

     

    1) for every method incl. constructor 

    write in this exact format (parenthesis immediately following method name + one space right before the curly brackets.)

    methodname() {

     

    }

     

    2) put space around = 

    //this didn't work

    this.strings=strings;

    //this worked

    this.strings = strings;

     

    this is so dumb..... 

     

    https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KBB6I0AX

0/9000

I am not able to complete my maintenance certification of the challenge relating to "Get Hands-On with an Iterable Variable in For Loops ". As I tried completing the challenge trail with following the instructions, I am receiving following error.

The constructor MyIterable should accept parameter of type List<String>

The output in the test run I am getting the proper result. It looks like there is an issue with the playground itself. 

Is anybody else facing the same issue?

 

#Trailhead Challenges  #Trailhead-challenges

10 条评论
  1. 1月30日 04:32

    Try this one for the constructor and the sample code below should work: 

     

    public class MyIterable implements Iterable<String> {

    private List<String> strings;

    public MyIterable(List<String> strings) {

    this.strings = strings;

    }

    public Iterator<String> iterator() {

    return strings.iterator();

    }

    }

     

    In case you need a Test Class: 

     

    @IsTest

    public class MyIterableTest {

    @IsTest

    static void testIterableForLoop() {

    List<String> strings = new List<String>{'Hello', 'World'};

    MyIterable iterable = new MyIterable(strings);

    for (String str : iterable) {

    System.debug(str);

    }

    }

    }

     

    https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KB1BF

0/9000