+ Start a Discussion
saisharan sarasaisharan sara 

code :
public class BankAcct {
private integer balance=0; public string acctName;
//Declare a public string attribute named accttype public string accttype;
//Declare a method, named makeDeposit, that accepts an integer named deposit //Within the method, add the deposit amount to the balance
public void makeDeposit (integer deposit) {
balance = balance + deposit; }
//Declare a method, named getBalance, that returns an integer public integer getBalance() {
//Return the balance attribute return balance; } }






error:
Step not yet complete in My Trailhead Playground 1
We can't find an Apex class named 'BankAcct' that contains the code provided in this step. 

 
Alok Prasad 6Alok Prasad 6 
Hi

I am tryied multiple things to complete the challenge for Display a Flow on a Page in Your Salesforce Org but getting the error - Make sure that the Contact Record page includes a Flow component, and that the Flow component references the 'Hello World' flow. 

I had also set component visiblity condition to match account name as required in challenge. still the error. pls guide
Nick VerschuerenNick Verschueren 
I'm doing the Lightning Experience Reports & Dashboards Specialist Superbadge and all was going fine, did a big part of the challenges, and suddenly while doing the dashboard, I get this error and can't seem to get past it....

"Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: UXHPPPDB"
User-added image
Is there a way to fix this without having to start all over again in a new playground?
Evaldas ZarankaEvaldas Zaranka 
Good afternoon, 
Looking for experts in Xcode for trailhead solution. 
https://trailhead.salesforce.com/content/learn/projects/mini-hack-mobile-sdk-ios/query-data-with-asynchronous-logic doing this part and keep getting this error, but when I build my project, everything looks correct - Screenshot attached from the simulator. 
We couldn't verify that LoadView() was configured. In Xcode, please add the LoadView() method to your AccountSceneController.swift file. When the app is ready, build and run it, and log in with your corresponding playground credentials.
AccountSceneController.swift
import Foundation
import UIKit
import SalesforceSDKCore

class AccountSceneController: UITableViewController {
    var dataRows = [Dictionary<String, Any>]()
    
    override func loadView() {
        super.loadView()
        self.title = "Accounts"
        let request = RestClient.shared.request(forQuery: "SELECT Id, Name FROM Account LIMIT 10")
        
        RestClient.shared.send(request: request, onFailure: { (error, urlResponse) in
            SalesforceLogger.d(type(of:self), message:"Error invoking: \(request)")
        }) { [weak self] (response, urlResponse) in
            
            guard let strongSelf = self,
                let jsonResponse = response as? Dictionary<String,Any>,
                let result = jsonResponse ["records"] as? [Dictionary<String,Any>] else {
                    return
            }
            
            SalesforceLogger.d(type(of:strongSelf),message:"Invoked: \(request)")
            
            DispatchQueue.main.async {
                strongSelf.dataRows = result
                strongSelf.tableView.reloadData()
            }
        }
    }
    
    // MARK: - Table view data source
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    override func tableView(_ tableView: UITableView?, numberOfRowsInSection section: Int) -> Int {
        return self.dataRows.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cellIdentifier = "AccountNameCellIdentifier"
        
        // Dequeue or create a cell of the appropriate type.
        let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier:cellIdentifier) ?? UITableViewCell(style: .subtitle, reuseIdentifier: cellIdentifier)
        
        // If you want to add an image to your cell, here's how.
        let image = UIImage(named: "icon.png")
        cell.imageView?.image = image
        
        // Configure the cell to show the data.
        let obj = dataRows[indexPath.row]
        cell.textLabel?.text = obj["Name"] as? String
        
        // This adds the arrow to the right hand side.
        cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
        return cell
    }
    
    
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "toContactsSceneController" {
            let destination = segue.destination as! ContactsSceneController
            let cell = sender as! UITableViewCell
            let indexPath = self.tableView.indexPath(for: cell)!
            if let accountName = self.dataRows[indexPath.row]["Name"] as? String {
                destination.name = accountName
            }
            if let accountId = self.dataRows[indexPath.row]["Id"] as? String {
                destination.accountId = accountId
            }
        }
    }
}

User-added image
 
Aryan JhaAryan Jha 
@istest
public class AccountProcessorTest {
@istest
    static void CountContactTest()
    {
        List<Account>accounts=new List<Account>();
        for(Integer i=0;i<300;i++)
        {
            accounts.add(new Account(Name='test account'+i));
        }
        insert accounts;
        List<Contact>contacts=new List<Contact>();
        List<Id>accountId=new List<Id>();
        for(Account a:accounts)
        {
            contacts.add(new Contact(Firstname=a.name,Lastname='testname',AccountId=a.id));
            accountId.add(a.id);    
        }
        insert contacts;
        Test.startTest();
        AccountProcessor.countContacts(accountId);
        Test.stopTest();
        List<Account>accs=[SELECT Id,Number_Of_Contacts__c FROM Account];
        for(Account acc:accs)
        {
            system.assertEquals(1,acc.Number_Of_Contacts__c);
        }
    }


}
PrashBPrashB 
Couple of months ago, I created one Org to build reports and dashboards and enabled Email me option to get one of the reports every week.

I now receive the report every week and wanted to disable the setting. I tried few options but didn't work. I then disconnected the Org hoping that, it will stop sending me weekly emails. But I still receive the report on a regular basis. The make it worst, I also forgot the username for the Org I disconnected.

Please let me know how I can disable the setting to stop receiving the report?
Aryan JhaAryan Jha 
public class AccountProcessor {
    @future
    public static void countContacts(List<ID>accountIds)
    {
        List<Account>accounts=[SELECT Id,(SELECT Id FROM Contacts) FROM Account WHERE Id IN:accountIds];
        for(Account acc:accounts)
        {
            acc.Number_Of_Contacts__c=acc.Contacts.size();
}
        update accounts;
    }


}

@istest
public class AccountProcessorTest {
@istest
    static void CountContactTest()
    {
        List<Account>accounts=new List<Account>();
        for(Integer i=0;i<300;i++)
        {
            accounts.add(new Account(Name='test account'+i));
        }
        insert accounts;
        List<Contact>contacts=new List<Contact>();
        List<Id>accountId=new List<Id>();
        for(Account a:accounts)
        {
            contacts.add(new Contact(Firstname=a.name,Lastname='testname',AccountId=a.id));
            accountId.add(a.id);    
        }
        insert contacts;
        Test.startTest();
        AccountProcessor.countContacts(accountIds);
        Test.stopTest();
        List<Account>accs=[SELECT Id,Number_Of_Contacts__c FROM Account];
        for(Account acc:accs)
        {
            system.assertEquals(1,acc.Number_Of_Contacts__c);
        }
    }
}
David Watson 43David Watson 43 
Hello, 

I'm tryng to complete Trailhead beginner training and I'm in the module where I have to modify the help menu. However, I cannot continue because the option to add a new resource is disabled.

Am I doing something wrong here?
Thanks.

User-added image
Best Answer chosen by David Watson 43
ShivankurShivankur (Salesforce Developers) 
Hi David,

To add a new resource, follow the steps below:
  • Hover your mouse on the Label and click on the inline edit icon.
  • Populate the above field.
  • Repeat the same steps for the URL column.
  • Click on Save.
You can refer to this help article for this issue:
https://help.salesforce.com/articleView?id=000355315

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
Robert RydlewskiRobert Rydlewski 
Hello, I am a new one here.  I am following the trailhead challenge but I am stuck on one of them for the past 2 weeks. 

Create a Custom Object and Custom Fields 

- Create a Custom Object
- Create a Custom Object Tab
- Create Custom Fields
- Create Energy Audit Records


The challenge basically needs to follow the steps of the program.
I finished all those steeps but I have an error saying
" The 'Type_of_Installation__c' field isn't the correct field type. Make sure it's a Picklist field and try again."

I don't really understand this error message and can't find information online regarding this topic 

I create a new playground and follow the steps in the challenge. 
When I finished again the same error. 

Does anyone have hints for me ??? it's been 2 weeks and I can't find a challange listproper solution. 


 
Best Answer chosen by Robert Rydlewski
PriyaPriya (Salesforce Developers) 

Hi Robert,

Delete the field "Type of Installation" which you have created. 

Now create a new field , chose Picklist as data type, enter the  label as "Type of Installation" 
and under value, select as "Enter values, with each value separated by a new line" 
as shown below :- 
User-added image

Try this and let us know if you still face the error. 

 

Please mark as Best Answer so that it can help others in the future.

Regards,

Priya Ranjan