• Naveen Choudhary
  • NEWBIE
  • 451 Points
  • Member since 2015


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 15
    Replies

Hi everyone,

i'm getting the following error after the system checks the challenge:

"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject"

I already tested it via Apex and via REST Explorer in Workbench, the code seems fine to me:

@restResource(urlMapping='/Account/*/contacts')
global class AccountManager {
	
    @httpGet
    global static Account getAccount(){
        RestRequest request = RestContext.request;
        String accountId = request.requestURI.substringBetween('/Account/' , '/contacts');
        
        Account result = [SELECT Id, Name, (SELECT Id,Name FROM Contacts) FROM Account WHERE Id = :accountId];
  
        return result;

    }
    
}


Can somebody help me with this?

Thank you,
Fabio

There was an unhandled exception. Please reference ID: RNXBGFXC. Error: Faraday::Error::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist 
Note: you may run into errors if you've skipped previous steps.
Hi Sonam,

I have also the same issue in completion of my trailheads that i have to create a lightning page and in my org lightning app builder is not enable.
Could you please enable it to my org ID
My Org ID : 00D28000000XRoSEAW
Hi Guys 

I have implemented the below class and also scheduled it . 

Still getting an error. 
Challenge Not yet complete... here's what's wrong: 
The Apex class does not appear to be implementing the execute() method.
Very sad to see was not able to complete in the first attempt after making everything right.

public class WarehouseSyncSchedule implements Schedulable {
  
    public void execute(SchedulableContext SC)
    {
        WarehouseCalloutService.runWarehouseEquipmentSync();
    }
    
}
Hello,

I have this error when I try to check challenge:

Challenge Not yet complete... here's what's wrong: 
Could not find an account named 'Blackbeards Grog Emporium' created from Workbench with the Description 'The finest grog in the seven seas.'


In the next picture you can see what I send by the Workbench

User-added image

The result is succes and in my Developer Org I can see the Account created correctly, but the challenge isn't passed.
Hello everyone I could use some help on the using future Methods trailhead. Please keep in mind I am not an Apex coder at all but I am trying to learn as much as I can.

Here is the Task

Create an Apex class with a method using the @future annotation that accepts a List of Account IDs and updates a custom field on the Account object with the number of contacts associated to the Account. Write unit tests that achieve 100% code coverage for the class.
Create a field on the Account object called 'Number_of_Contacts__c' of type Number. This field will hold the total number of Contacts for the Account.
Create an Apex class called 'AccountProcessor' that contains a 'countContacts' method that accepts a List of Account IDs. This method must use the @future annotation.
For each Account ID passed to the method, count the number of Contact records associated to it and update the 'Number_of_Contacts__c' field with this value.
Create an Apex test class called 'AccountProcessorTest'.
The unit tests must cover all lines of code included in the AccountProcessor class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.

I have written an Apex class and a Test class but I think I am doing them both Wrong: because when I try to check the challenge i Get this error

Challenge Not yet complete... here's what's wrong: 
The 'AccountProcessorTest' test class doesn't appear to be calling the 'AccountProcessor.countContacts' method between Test.startTest() and Test.stopTest().


When I run the Test class I get this error :

System.QueryException: List has no rows for assignment to SObject

Here is the CLASS:
 
public class AccountProcessor {
     @future

  public static void someFutureMethod(List<id> scope) {

   Account[] updates = new Account[] {};
        for (AggregateResult ar : [
                select AccountId a, count(Id) c
                from Contact
                where AccountId in :scope
                group by AccountId
                ]) {
            updates.add(new Account(
                    Id = (Id) ar.get('a'),
                    Number_of_Contacts__c = (Decimal) ar.get('c')
                    ));
        }
        update updates;
    }

}

Here is the Test Class:
 
@IsTest
public class AccountProcessorTest {
  public static testmethod void TestAccountProcessorTest() {
 
Test.startTest();
     Account a = new Account();
        a.Name = 'Test Account';
        Insert a;
      
      Contact cont = New Contact();
      
      cont.FirstName ='Bob';
      cont.LastName ='Masters';
      cont.AccountId = a.Id;
      Insert cont;

    Test.stopTest() ;
     Contact ACC = [select AccountId from Contact where id = :a.id LIMIT 1];

 
        System.assert(Cont.AccountId != null);
        System.assertequals(cont.id, ACC.AccountId);

  }}

I have used alot or diffrent google searches to get me this far. But I have not Idea if Im even remotly close to the right answer or not.


 

Hi everyone,

i'm getting the following error after the system checks the challenge:

"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject"

I already tested it via Apex and via REST Explorer in Workbench, the code seems fine to me:

@restResource(urlMapping='/Account/*/contacts')
global class AccountManager {
	
    @httpGet
    global static Account getAccount(){
        RestRequest request = RestContext.request;
        String accountId = request.requestURI.substringBetween('/Account/' , '/contacts');
        
        Account result = [SELECT Id, Name, (SELECT Id,Name FROM Contacts) FROM Account WHERE Id = :accountId];
  
        return result;

    }
    
}


Can somebody help me with this?

Thank you,
Fabio

Hi,

For the Apex web services challenge, I have written the following class

@RestResource(urlMapping='/Accounts/*/contacts')
global with sharing class AccountManager {
     @HttpGet
    global static Account getAccount(){
        RestRequest request = RestContext.request;
        String Accountid = request.requestURI.substring(10,25);
        Account result = [SELECT id,name ,(SELECT id,name from contacts) from Account where id=:Accountid];
        return result;
    }
}

When I test this with passing the account ID in Workbench REST Explorer I am able to fetch both the account details as well as it's associated contact details.

But when I check the challenge I get the below error.

There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject

Any Help?

Thanks & Regards,
Abhiram Sheshadri
The instructions state:

"The method must return the ID and Name for the requested record and all associated contacts with their ID and Name."

I am returning a List<sObject> where the first object is the Account and the remaining objects are the Contacts.

The error message is:

"Executing the 'AccountManager' method failed. Either the service isn't configured with the correct urlMapping, is not global, does not have the proper method name or does not return the requested account and all of its contacts."

I assume it is looking for a different structure to be returned by getAccount() besides List<sObject> but since Account doesn't have a field to store associated Contacts, I'm not sure what to return.

Anyone able to clarify for me what type & structure the return value should have?
I've completed the challenge, it has 100% coverage. I've checked all the method names. The URL is valid. I've used Work Bench and curl to test and even tested with multiple Accounts with and without contacts.

I know on other challenges, punctionation was important.  What about the defination of the return? Are there expected names?

I built a class to hold Account ID & Name along with a List of Contact names and IDs. Is this my issue?  Anyone else have a challenge with this challenge?


Any help or hints will be appreciated.

Here are snippets of my code:

@RestResource(urlMapping='/Accounts/*/contacts')
global with sharing class AccountManager {

....

global class APIAccount {
        public ID Id;
        public String Name;
        List<APIContact> Contacts;

...

@HttpGet
    global static APIAccount getAccount() {
        RestRequest request = RestContext.request;
...
 
There was an unhandled exception. Please reference ID: RNXBGFXC. Error: Faraday::Error::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist 
Note: you may run into errors if you've skipped previous steps.
Hi Sonam,

I have also the same issue in completion of my trailheads that i have to create a lightning page and in my org lightning app builder is not enable.
Could you please enable it to my org ID
My Org ID : 00D28000000XRoSEAW
I don't see a Setup menu to run the Lightning App Builder for a challange.  I'm using the Summer `15 Developer Edition.  How is it enabled? 

Hi guys,

1) I need some help sorting out on how to make the 'getNewCases' Apex method should have the return type of 'List' and return a list of case records with the ID and CaseNumber fields and filtered to only have a status of 'New'. My SOQL Where clause does not work as expected.
2) I am getting an error stating: "The page does not include a repeat component", but I am pretty sure that I am using it. Please refer to the Images below
User-added image

User-added image

 

Overall tasks I have performed step-by-step are:

The page must be named 'NewCaseList'.
The custom controller Apex class must be named 'NewCaseListController'.
The 'NewCaseListController' Apex class must have a publically scoped method named 'getNewCases'.
The 'getNewCases' Apex method should have the return type of 'List' and return a list of case records with the ID and CaseNumber fields and filtered to only have a status of 'New'.
The 'NewCaseList' Visualforce page must use an apex:repeat component which is bound to 'newCases'.
The apex:repeat component must refer to the var attribute as 'case'.
Within the apex:repeat component, bind a apex:outputLink component to the ID of the case so that the page directs the user to the detail page of the respective case record.