• Daniel Wu
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Coshno

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I found a weird issue when I complete the Advanced Apex Specialist badge. This superbadge is 6000 points, but I got 12000 points. Is it correct? I think the system calculate the points(6000) of this superbadge twice. Can someone look into this issue?
I like the trailhead.I learned a lot here, it's very cool. Wish it best.

Thanks!
I found a weird issue when I complete the Advanced Apex Specialist badge. This superbadge is 6000 points, but I got 12000 points. Is it correct? I think the system calculate the points(6000) of this superbadge twice. Can someone look into this issue?
I like the trailhead.I learned a lot here, it's very cool. Wish it best.

Thanks!
Am running into an error in the Trailhead module for Packaging2.  I've downloaded the DreamHouse app and created the package without error.  But when I try to create a new version of the package, I get "An unexpected error occurred.  Please contact Salesforce Support and provide the following error code...."  It runs for about 2 minutes before it runs into this error.  I've started over from scratch.  I've remembered to put the pakcage id into the sfdx-project.json file.  I've double-checked that I'm connected to my DevHub.  I've double-checked that the force-app folder has the appropriate contents.  Any ideas where else to look?
I'm trying to create a wrapper for my row return but I somehow need 2 classes to accomplish this.  I've only successfully written one of the classes which returns a string.  How do I take this new query - and make it into a wrapper?

New dnbData2 query:
dnbData2 = [SELECT companyID, Name, DunsNumber,City,State,Country,Zip FROM DatacloudDandBCompany WHERE Name IN :  nameFragments LIMIT 50];

Old Class that only returns a string:
Public class Foobar{

        @AuraEnabled 
    public static List<String> getDnBMatches(String companyName){
        List<String> dnbFinalMatchList = new List<String>();  
        List<String> dnbCompleteMatches = new List<String>(); 
        List<String> dnbPartialMatches = new List<String>();
        List<String> nameFragments = new List<String>();
        List<DatacloudDandBcompany> dnbData2 = new List<DatacloudDandBcompany>();
        Integer emptyList = 0;
        Map<id,DatacloudDandBcompany> dnbData = new Map<id,DatacloudDandBcompany>();
   
        if (String.isBlank(companyName)){
                system.debug('DC - No Company Name');
                return null;
        }else{
                for (String fragment : companyName.split(' ')){
                     nameFragments.add(fragment);
                     system.debug('DC - Fragments - ' + nameFragments);
                     } 
                     
               dnbData2 = [SELECT companyId, Name FROM DatacloudDandBCompany WHERE Name IN :('Deloitte','Consulting') LIMIT 50];
               system.debug(dnbData2);

                for (DatacloudDandBCompany c: dnbData2 ){
                    if (companyName == c.name){
                        dnbCompleteMatches.add(c.companyid);
                        system.debug('DC - dnbComplete Matches Loop');
                    }
                    dnbPartialMatches.add(c.companyid); 
                    system.debug('DC - dnbPartial Matches Loop');
                }

                if (dnbCompleteMatches.size() > emptyList) {
                    system.debug('DC - dnbComplete Matches Loop' + dnbCompleteMatches);
                    return dnbCompleteMatches;
                    

                }
                else {
                    return dnbPartialMatches;
                    

                }
         
        }
    }    
}
Please note, I have to keep the data manipulation in the new version (i.e. string fragment work, complete and partial results additions, etc.)