+ Start a Discussion
Allison WrightAllison Wright 
I'm stuck on the second part of this project.  Every time I try to upload the supposedly correctly formatted version, I receive this error: JSON related error messageI'm not really sure what to do here in order to fix it and there's very limited information available.  I also created a new DE, deleted all of the files and started over...same problem.  Any advice?
Samantha StubbsSamantha Stubbs 
When doing the Assign Top Leads to Your Sales Rep trailhead module I keep getting this Error.
User-added image
On my end the process builder and everything else seems to be right. This is a brand new org I have only used for this trail.
sivasankar sharmasivasankar sharma 
There was an unhandled exception. Please reference ID: HDCTPKQR. Error: Restforce::ErrorCode::MalformedQuery. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2

I am struck here can anyone please help
Noah BensalemNoah Bensalem 
where can i access all of the salesforce exam guides?
Rohit MamidwarRohit Mamidwar 
Hey there,
I have created a new trailhead playground for the superbadge challenge.
But I am getting encountered with the error given below

reference error id: PPUYSGJIPlease help me with this
reference error id: PPUYSGJI

Thanks
Venu Gopala Krishna Kukkapalli 9Venu Gopala Krishna Kukkapalli 9 
I'm facing this issue while validating the challenge 8 in Advanced apaex specialist I'm not getting exactly what I'm missing here.
I have posted the code I used.... Can anyone help me to figure out the issue.

Thanks in Advance!!
public Without Sharing class Product2Extension {

    public List<ProductWrapper> productsToInsert {get;set;}

    public Product2Extension(ApexPages.StandardController controller){
        productsToInsert = new List<ProductWrapper>();
        AddRows();
    }

    public void AddRows(){
        for ( Integer i=0; i<Constants.DEFAULT_ROWS; i++ ){
            ProductWrapper prodWrapper = new ProductWrapper();
            productsToInsert.add( prodWrapper );
        }
    }

    public List<ChartHelper.ChartData> GetInventory(){
        return ChartHelper.GetInventory();
    }

    public PageReference Save(){
        SavePoint sp1 = Database.setSavepoint();
        System.debug('-----------------------------------------------------1');
        try {
            System.debug('-----------------------------------------------------2');
            Map<Integer, Product2> products = new Map<Integer, Product2>();
            Map<Integer, PriceBookEntry> priceBookEntries = new Map<Integer, PriceBookEntry>();    
            Integer index = 0;
            for(ProductWrapper prdWrapper : productsToInsert) {
                if(String.isNotBlank(prdWrapper.productRecord.Name) && prdWrapper.pricebookEntryRecord.UnitPrice!=null && 
                   prdWrapper.productRecord.Initial_Inventory__c!=null && prdWrapper.productRecord.isActive && 
                   prdWrapper.productRecord.Initial_Inventory__c != 0 && prdWrapper.pricebookEntryRecord.UnitPrice!=0){
                          
                    products.put(index,prdWrapper.productRecord);
                    priceBookEntries.put(index,prdWrapper.pricebookEntryRecord);
                    index ++;
                }
            }
            
            insert products.values();
            System.debug('-----------------------------------------------------3');
            List<PriceBookEntry> pbList = new List<PriceBookEntry>();
            for(Integer mapIndex : products.keySet()) {
                PriceBookEntry currentPBEntry = priceBookEntries.get(mapIndex);
                if(products.get(mapIndex).Id!=null) {
                    currentPBEntry.Pricebook2Id = Constants.STANDARD_PRICEBOOK_ID;
                    System.debug('' + products.get(mapIndex).Id);
                    currentPBEntry.Product2Id = products.get(mapIndex).Id;
                    currentPBEntry.IsActive = true;
                    pbList.add(currentPBEntry);
                }
                
            }
            
            insert pbList;
            System.debug('-----------------------------------------------------4');

            //If successful clear the list and display an informational message
            apexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO,pbList.size()+' Inserted'));
            productsToInsert.clear();   //Do not remove
            addRows();  //Do not remove
        } catch (Exception e){
            apexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR,Constants.ERROR_MESSAGE));
            Database.rollback(sp1);
        }
        return null;
    }
    
    public List<SelectOption> GetFamilyOptions(){
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption(Constants.SELECT_ONE,Constants.SELECT_ONE));
        for(Schema.PicklistEntry entry : Constants.PRODUCT_FAMILY){
            options.add(new SelectOption(entry.getLabel(),entry.getValue()));
        }
        return options;
    }
    
    
    public class ProductWrapper{
        public Product2 productRecord {get;set;}
        public PriceBookEntry pricebookEntryRecord {get;set;}
        
        public ProductWrapper() {
            productRecord = new Product2(Initial_Inventory__c =0);
            pricebookEntryRecord = new PricebookEntry(Unitprice=0.0);
        }
    }

}
Akash DeokarAkash Deokar 
Hello team,
 
I have stuck in Apex specialist superbadge(Challenge 5), Please help me with the resolution. I have written class WarehouseCalloutService, which is getting executed without error if i called it from debug log But getting runtime error while running test class written for that class.
 
Getting Error :- FATAL_ERROR System.TypeException: Invalid conversion from runtime type Map<String,ANY> to List<ANY>
 
 
class:-WarehouseCalloutService
global with sharing class WarehouseCalloutService {
    
private static final String WAREHOUSE_URL = 'https://th-superbadge-apex.herokuapp.com/equipment';    
    @future (callout=true)
    public static void runWarehouseEquipmentSync() {
        //ToDo: complete this method to make the callout (using @future) to the
        //      REST endpoint and update equipment on hand.
        Http http = new Http();
        HttpRequest req  = new HttpRequest();
        req.setEndpoint(WAREHOUSE_URL);
        req.setMethod('GET');
        HttpResponse res = http.send(req);
        
        if(res.getStatusCode()==200){
            List<object> results = (List<object>)JSON.deserializeUntyped(res.getBody());
            system.debug(results);
            List<Product2> productlist = new List<Product2>();
            for(Object o : results){
                Map<string,Object> eqp = (Map<String,Object>)o;
                system.debug(eqp);
                Product2 equipment = new Product2();                
                equipment.Replacement_Part__c = (Boolean)eqp.get('replacement');
                equipment.Current_Inventory__c = (Decimal)eqp.get('quantity');
                equipment.Lifespan_Months__c = (Integer)eqp.get('lifespan');
                equipment.Maintenance_Cycle__c = (Integer)eqp.get('maintenanceperiod');
                equipment.Name = (String)eqp.get('name');
                equipment.Cost__c = (Integer)eqp.get('cost');
                equipment.ProductCode = (String)eqp.get('_id');
                equipment.Warehouse_SKU__c = (String)eqp.get('sku');
                productlist.add(equipment);
            }
            system.debug(productlist);
            upsert productlist;
        }
    }
}

 
myntra flipkartmyntra flipkart 
Hi, folks, I'm new to this salesforce I wanted to explore my career in salesforce and so I'm having some questions.

How the work will be allocated for an employer in the salesforce department? Do they use any tool for that?