• SFDC pv
  • NEWBIE
  • 40 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 20
    Replies

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.CalloutException: The callout couldn't access the endpoint. You might not have the required permissions, or the named credential "ProjectService" might not exist.
Close errors
Please let me know whats wrong. 
Package.xml

<?xml version="1.0" encoding="UTF-8"?>  
<Package xmlns="http://soap.sforce.com/2006/04/metadata">  
   <types>  
     <members>Archival_Data__b</members>  
     <name>CustomObject</name>  
   </types>  
   <types>  
     <members>Archival_Data</members>  
     <name>PermissionSet</name>  
   </types>  
   <version>41.0</version>  
</Package>    

I stored Archival_Data__b.Object in the object folder and Archival_Data.permissionSet in the permissionsets folder. 
Apex class:-
@AuraEnabled
    public static String updatecase(String caseId, String accountId, String results)
    {       
       
        Set<String> loffinstr = new Set<String>();
        List<XXX> DFFlist= new list<XXX>([SELECT Number__c FROM XXX WHERE Case__c =:CaseId ]);
        for(XXX finfo : DFFlist ){
            loffinstr.add(finfo.Number__c);
        }
        List<XXX>  lstpss= new List<XXX>();
        List<Object> fieldList = (List<Object>)JSON.deserializeUntyped(results);
        System.debug('ffmap'+results);
        
        if(!fieldList.isEmpty()) {
            for(Object fld : fieldList){    
                Map<String,Object> data = (Map<String,Object>)fld;
                system.debug(data.get('key1'));
                if(!loffinstr.contains(String.valueOf(data.get('key2'))))  {    
                    XXX FFrecs = new XXX();
                    FFrecs.Case__c = caseId;
                    FFrecs.Account__c = accountId;
                    FFrecs.Name = String.valueOf(data.get('key0'));
                    lstpss.add(FFrecs);     
                } 
            }
        }
        insert  lstpss;
    }

    Helper class :-

        //call apex class method
        var action = component.get('c.updatecase');
            //var objList = component.get("v.selectedpss");
            var myMap = component.get("v.selectedpss");
            console.log('type 2-' + typeof myMap);
            console.log('ValuesOfmyMap' +JSON.stringify(myMap));
            action.setParams({
                "caseId": component.get("v.CaseId"),
                "accountId" : component.get("v.AccountId"),
                "results" : JSON.stringify(myMap)
            });

Especially tell me how to pass the parameter(caseid,accountid,results) which is in Helper to Apex test class
        <aura:iteration items="{!v.freqFlyerList}" var="wrap" indexVar="idx">
                                    <tr>
                                        <th>
                                            <label class="slds-checkbox">
                                                <ui:inputCheckbox aura:id="test" value="" text="{!idx}" />
                                                <span class="slds-checkbox--faux" />
                                                <span class="slds-form-element__label"></span>
                                            </label>
                                        </th>
                                        <th scope="row">
                                            <div class="slds-truncate" title="{!wrap.key1}">{!wrap.key1}</div>
                                        </th>
                                        <td class="slds-truncate">
                                            {!wrap.key2}
                                        </td>
                                        <td class="slds-truncate">
                                            {!wrap.key3}
                                        </td> 
                                        <td class="slds-truncate">
                                            {!wrap.key4}
                                        </td>
                                        <td class="slds-truncate">
                                            {!wrap.key5}
                                        </td> 
                                        <td class="slds-truncate">
                                  <lightning:select aura:id="ReqPicklist" onchange="{!c.ReqTypechange}">
                                              <option value="">Please select</option>
                                              <option value="val1">val1</option>
                                              <option value="val2">val1</option>
                                              <option value="val3">val1</option>
                                </lightning:select>
                                    </td>
                                         <td class="slds-truncate">
                                           <lightning:select aura:id="TierPicklist" onchange="{!c.UpgTierchange}">
                                              <option value="">Please select</option>
                                              <option value="val1">val1</option>
                                              <option value="val2">val2</option>
                                              <option value="val3">val3</option>
                                           </lightning:select>
                                        </td>    
                                    </tr>
                                </aura:iteration>
Onchange ctrlr:-

ReqTypechange : function(component, event, helper) {
        var pickReqTypeval = component.find("ReqPicklist").get("v.value");
        console.log('ReqPicklist-'+ReqPicklist);
    },
    
    UpgTierchange : function(component, event, helper) {
        var pickUpgTierval = component.find("TierPicklist").get("v.value");
        console.log('Tierval-'+Tierval);
    }, 
                                <aura:iteration items="{!v.freqFlyerList}" var="wrap" indexVar="idx">
                                    <tr>
                                        <th>
                                            <label class="slds-checkbox">
                                                <ui:inputCheckbox aura:id="checkFreqFlyer" value="" text="{!idx}" />
                                                <span class="slds-checkbox--faux" />
                                                <span class="slds-form-element__label"></span>
                                            </label>
                                        </th>
                                        <th scope="row">
                                            <div class="slds-truncate" title="{!wrap.key1}">{!wrap.key1}</div>
                                        </th>
                                        <td class="slds-truncate">
                                            {!wrap.key2}
                                        </td>
                                        <td class="slds-truncate">
                                            {!wrap.key3}
                                        </td> 
                                        <td class="slds-truncate">
                                            {!wrap.key4}
                                        </td>
                                        <td class="slds-truncate">
                                            {!wrap.key5}
                                        </td> 
                                        <td class="slds-truncate">
                                  <lightning:select aura:id="ReqPicklist" onchange="{!c.ReqTypechange}">
                                              <option value="">Please select</option>
                                              <option value="val1">val1</option>
                                              <option value="val2">val1</option>
                                              <option value="val3">val1</option>
                                </lightning:select>
                                    </td>
                                         <td class="slds-truncate">
                                           <lightning:select aura:id="UpgradeTierPicklist" onchange="{!c.UpgTierchange}">
                                              <option value="">Please select</option>
                                              <option value="val1">val1</option>
                                              <option value="val2">val2</option>
                                              <option value="val3">val3</option>
                                           </lightning:select>
                                        </td>    
                                    </tr>
                                </aura:iteration>
Onchange ctrlr:-

ReqTypechange : function(component, event, helper) {
        var pickReqTypeval = component.find("RequestTypePicklist").get("v.value");
        console.log('reqtypevalue-'+pickReqTypeval);
    },
    
    UpgTierchange : function(component, event, helper) {
        var pickUpgTierval = component.find("UpgradeTierPicklist").get("v.value");
        console.log('pickUpgTierval-'+pickUpgTierval);
    }, 

This is working for only one rows if i have more than rows its not allowing me to select the values its throwing error " $ReqTypechange [component.find(...).get is not a function]"
@AuraEnabled
    public static String insertinfo(String caseId, String accountId, List<String> results)
    {
        system.debug('ffmap'+results);    
        list<objectWrap> myWrap = (list<objectWrap>)results;    //Getting error here . Also ffmap is not coming in the valid format 
 }
ffmap log :- ({key=123, value={key1=KEITH W PETERSON, key2=123, key3=null, key4=Bronze, key5=31-Jan-2019}}, {key=456, value={key1=JOYCE P WEST, key2=456, key3=xdkzwhzorm@uaowz.qca, key4=Bronze, key5=31-Jul-2018}})

From helper i am getting proper json format whereas in the apex ctrlr am getting the result in valid format
My helper class :- 

CreateHelper: function(component, event) {
        //call apex class method
        var action = component.getinsertinfo
            var myMap = component.get("v.selectednos");
            console.log('Mymapvalue' + myMap);
            action.setParams({
                "caseId": component.get("v.CaseId"),
                "accountId" : component.get("v.AccountId"),
                "results" : myMap
            });

log:-
Mymapvalue'  :-   [{"key":"123","value":{"key1":"KEITH W PETERSON","key2":"123","key3":null,"key4":"Bronze","key5":"31-Jan-2019"}},{"key":"456","value":{"key1":"JOYCE P WEST","key2":"456","key3":"xdkzwhzorm@uaowz.qca","key4":"Bronze","key5":"31-Jul-2018"}}]
                                        <td class="slds-truncate">
                                            <select>
                                              <option value="">Please select</option>
                                              <option value="xxx">xxx</option>
                                              <option value="yyy">yyy</option>
                                              <option value="zzz">zzz</option>
                                            </select>
                                        </td>
    @auraEnabled
    Public static List<string> invokeWebServiceString ssnumber) {
        String [] arrayOfResponsestrings = new List<String>();

        for(String num : ssnumber.split(',')){          
            ResponseWrapper APIResponse = InvokeAPI.invokeRespAPI(num);
            arrayOfResponsestrings.add(JSON.serialize(APIResponse ));
            System.debug('arrayOfResponsestrings :'+arrayOfResponsestrings);
        }
        for(Integer i=0 ;i<arrayOfResponsestrings.size() ; i++) {
        }
        return arrayOfResponsestrings;
    } 
  • September 30, 2018
  • Like
  • 0
intosearchHelper
Test_ModalSearchComponent.js:16 actionSecureAction: [object Object]{ key: {"namespace":"c"} }
Test_ModalSearchComponent.js:23 ####returnvalueERROR
Test_ModalSearchComponent.js:25 ####parentIdnull
Test_ModalSearchComponent.js:14 intosearchHelper
Test_ModalSearchComponent.js:16 actionSecureAction: [object Object]{ key: {"namespace":"c"} }
Test_ModalSearchComponent.js:23 ####returnvalueERROR
Test_ModalSearchComponent.js:25 ####parentIdnull

Test_ModalSearchComponent:-
<aura:component controller ="Test_xxController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
                      <div style="display:inline-block;margin-right:10px" onclick="{!c.Search}">
                        <lightning:icon iconName="utility:search" size="small" >
                           </lightning:icon>

Controller:-

({
        Search : function(component, event, helper) {
        var action = component.get("c.invokeWebService");
        console.log('action');
        action.setParams({
            "CaseId" : component.get("v.recordId")
        
        });
        action.setCallback(this, function(response) {
        var state = response.getState();
        console.log('####returnvalue'+state);
        var parentId = component.get('v.recordId');
        console.log('####parentId'+response.getReturnValue());
        
        if (state == "SUCCESS") {
                var output = response.getReturnValue();
                component.set("v.response", output);
                console.log(output);
        }   
   });
             $A.enqueueAction(action);
},
})

Apex controller:-

global class Test_xxController {
    
    @AuraEnabled
    @future(callout=true)
    Public static void invokeWebService(String CaseId) {
        
        Map <String,xx_Information__c > FFMap = new Map <String,xx_Information__c> ();   
        
        Map<String, Integer> monthAndMonthNumberMap = new Map<String, Integer>();
        monthAndMonthNumberMap.put('Jan', 1);
        monthAndMonthNumberMap.put('Feb', 2);
        monthAndMonthNumberMap.put('Mar', 3);
        monthAndMonthNumberMap.put('Apr', 4);
        monthAndMonthNumberMap.put('May', 5);
        monthAndMonthNumberMap.put('Jun', 6);
        monthAndMonthNumberMap.put('Jul', 7);
        monthAndMonthNumberMap.put('Aug', 8);
        monthAndMonthNumberMap.put('Sep', 9);
        monthAndMonthNumberMap.put('Oct', 10);
        monthAndMonthNumberMap.put('Nov', 11);
        monthAndMonthNumberMap.put('Dec', 12);
        
        List<Case> Caslist= [SELECT Id,AccountID,xx_Number__c FROM Case  WHERE ID =:CaseId ];
        List<xx_Information__c> listofFF = new List<xx_Information__c>();
        List<xx_Information__c> DFFlist= new list<xx_Information__c>([SELECT xx_Number__c FROM xx_Information__c WHERE Case__c =:CaseId ]);
        
        Set<String> loffinstr = new Set<String>();
        Set<String> Dloffinstr = new Set<String>();
        Set<String> Nloffinstr = new Set<String>();
        Boolean isDuplicate;
        for(xx_Information__c finfo : DFFlist ){
            loffinstr.add(finfo.xx_Number__c);
            Dloffinstr.add(finfo.xx_Number__c);
            
        }
        Case Cas= [SELECT Id,AccountID,xx_Number__c FROM Case  WHERE ID =:CaseId ];
        system.debug('***Case-FF***'+Cas);
 
            for (String num : Cas.xx_Number__c.split(',') )
            {
                system.debug('Numbers'+num);
                if (Nloffinstr.Contains(num)) {
                  //  Isduplicate = true;                
                }
                else {
                    Nloffinstr.add(num);
                }
                
                if(num!='' && !loffinstr.contains(num)){
                    system.debug('insideloop'+num);
                    loffinstr.add(num);
                    xx_ResponseWrapper xxResponse = xx_InvokeAPI.invokexxAPI(num);                 
                    system.debug('$$$xxResponse$$$'+xxResponse);              
                    if(xxResponse != Null){
                        xx_Information__c ff = new xx_Information__c();
                        ff.Name = xxResponse.firstName+' '+xxResponse.lastName;
                        ff.xx_Email__c = xxResponse.email;
                        ff.xx_Number__c = num;
                        ff.Case__c = Cas.ID;
                        ff.Account__c = Cas.AccountId;
                        
                        for(xx_xxResponseWrapper.programDetails  program: xxResponse.programDetails){
                            if(program.ffExpireDate!=null){
                                String myDateStr = program.ffExpireDate;
                                System.debug('$$$ mydateStr: '+ myDateStr);
                                List<String> myDateList = myDateStr.split('-');
                                Integer yearVal = Integer.valueOf(myDateList.get(2));
                                Integer monthVal = monthAndMonthNumberMap.get(myDateList.get(1));
                                Integer dayVal = Integer.valueOf(myDateList.get(0));
                                date mydate = date.newinstance(yearVal,monthVal,dayVal);
                                ff.Freq_Flyer_Expiry_Date__c = mydate;
                                ff.Current_Tier__c = program.tierName;
                            }                         
                        }
                        ff.Request_Type__c = '';
                        ff.Upgrade_Tier_Requested__c = '';                               
                        listofFF.add(ff);
                    }
                }
            }            

        if(listofFF.size()>0) {
            insert listofFF;              
            system.debug('Insertion'+listofFF);    
        }
    }
}
  • September 18, 2018
  • Like
  • 0
If i click on the "New Button" i need to call the child component which is a pop up window. 
This is my component  i will place the below icon on my case page

Parent Component : - 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" controller ="Test_CreateXXController" access="global" >
   
   <aura:attribute name="isOpen" type="boolean" default="false"/>
   <aura:attribute name="recordId" type="String" />  
   <c:Testcomponent  aura:id="child"/>
 <!--  <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> -->
   <div onclick="{!c.doInit}">
        <a class="Fontcolor" href=""><lightning:card iconName="utility:info" title="New Button" /></a>          
    </div> 
<!-- </div> -->    
</aura:component>

Controller:-

({
    doInit: function(component, event, helper) {
        
        console.log('intosearch');
      //helper.Navigate(component, event, helper);      
          var testComponent = component.find('child');
        console.log('childcomponent');
          testComponent.getchildMethod(); 

   } 

})
Child component :- 

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:method name="getchildMethod" action="{!c.doAction}"/
    <aura:attribute name="isOpen" type="boolean" default="True"/>    

This is not working. Please help me out.
  • September 17, 2018
  • Like
  • 0
Map <List<String>,XXX__c > FFMap = new Map <List<String>,XXX__c> ();
List<Case> Caslist= [SELECT Id,AccountID,Number__c FROM Case  WHERE ID =:CaseId ];
Set<String> xxset = new Set<String>(); 
for (Case cs: Caslist) {
                xxset.add(cs.Number__c);
         }
          List<string> str = new List<string>();
          for (xxx__c xxinfo: [select id,Account__c,Case__c,Number__c from XXX__c where Number__c in :xxset and Case__c = :CaseId ]) { 
              str.add(xxinfo.Number__c);
              xxMap.put(str, xxinfo);
            }
if(Cas.Number__c!=null) {
            for (String num : Cas.Number__c.split(',') )
            {              
                if(num!=''  && !xxMap.containskey(num)) {   // Recieving error here  (Method does not exist or incorrect signature: void containskey(String) from the type Map<List<String>,XXX__c>)
}
}
}
 
Map <List<String>,XXX__c > FFMap = new Map <List<String>,XXX__c> ();
List<Case> Caslist= [SELECT Id,AccountID,Number__c FROM Case  WHERE ID =:CaseId ];
Set<String> xxset = new Set<String>(); 
for (Case cs: Caslist) {
                xxset.add(cs.Number__c);
         }
          List<string> str = new List<string>();
          for (xxx__c xxinfo: [select id,Account__c,Case__c,Number__c from XXX__c where Number__c in :xxset]) { 
              str.add(xxinfo.Number__c);
              xxMap.put(str, xxinfo);
            }
if(Cas.Number__c!=null) {
            for (String num : Cas.Number__c.split(',') )
            {              
                if(num!=''  && !xxMap.containskey(num)) {   // Recieving error here  (Method does not exist or incorrect signature: void containskey(String) from the type Map<List<String>,XXX__c>)
}
}
}

Can someone correct me on what mistake i did in above snippet. 
@AuraEnabled
    public static String insertinfo(String caseId, String accountId, List<String> results)
    {
        system.debug('ffmap'+results);    
        list<objectWrap> myWrap = (list<objectWrap>)results;    //Getting error here . Also ffmap is not coming in the valid format 
 }
ffmap log :- ({key=123, value={key1=KEITH W PETERSON, key2=123, key3=null, key4=Bronze, key5=31-Jan-2019}}, {key=456, value={key1=JOYCE P WEST, key2=456, key3=xdkzwhzorm@uaowz.qca, key4=Bronze, key5=31-Jul-2018}})

From helper i am getting proper json format whereas in the apex ctrlr am getting the result in valid format
My helper class :- 

CreateHelper: function(component, event) {
        //call apex class method
        var action = component.getinsertinfo
            var myMap = component.get("v.selectednos");
            console.log('Mymapvalue' + myMap);
            action.setParams({
                "caseId": component.get("v.CaseId"),
                "accountId" : component.get("v.AccountId"),
                "results" : myMap
            });

log:-
Mymapvalue'  :-   [{"key":"123","value":{"key1":"KEITH W PETERSON","key2":"123","key3":null,"key4":"Bronze","key5":"31-Jan-2019"}},{"key":"456","value":{"key1":"JOYCE P WEST","key2":"456","key3":"xdkzwhzorm@uaowz.qca","key4":"Bronze","key5":"31-Jul-2018"}}]
                                        <td class="slds-truncate">
                                            <select>
                                              <option value="">Please select</option>
                                              <option value="xxx">xxx</option>
                                              <option value="yyy">yyy</option>
                                              <option value="zzz">zzz</option>
                                            </select>
                                        </td>
    @auraEnabled
    Public static List<string> invokeWebServiceString ssnumber) {
        String [] arrayOfResponsestrings = new List<String>();

        for(String num : ssnumber.split(',')){          
            ResponseWrapper APIResponse = InvokeAPI.invokeRespAPI(num);
            arrayOfResponsestrings.add(JSON.serialize(APIResponse ));
            System.debug('arrayOfResponsestrings :'+arrayOfResponsestrings);
        }
        for(Integer i=0 ;i<arrayOfResponsestrings.size() ; i++) {
        }
        return arrayOfResponsestrings;
    } 
  • September 30, 2018
  • Like
  • 0
If i click on the "New Button" i need to call the child component which is a pop up window. 
This is my component  i will place the below icon on my case page

Parent Component : - 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" controller ="Test_CreateXXController" access="global" >
   
   <aura:attribute name="isOpen" type="boolean" default="false"/>
   <aura:attribute name="recordId" type="String" />  
   <c:Testcomponent  aura:id="child"/>
 <!--  <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> -->
   <div onclick="{!c.doInit}">
        <a class="Fontcolor" href=""><lightning:card iconName="utility:info" title="New Button" /></a>          
    </div> 
<!-- </div> -->    
</aura:component>

Controller:-

({
    doInit: function(component, event, helper) {
        
        console.log('intosearch');
      //helper.Navigate(component, event, helper);      
          var testComponent = component.find('child');
        console.log('childcomponent');
          testComponent.getchildMethod(); 

   } 

})
Child component :- 

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:method name="getchildMethod" action="{!c.doAction}"/
    <aura:attribute name="isOpen" type="boolean" default="True"/>    

This is not working. Please help me out.
  • September 17, 2018
  • Like
  • 0
In my organization we have so many classes ,I am not able to map approiate test class with actual class as their naming convention is different of that of class .
is there any way to find out plz help me.
Thanks in advance for ur help.
Map <List<String>,XXX__c > FFMap = new Map <List<String>,XXX__c> ();
List<Case> Caslist= [SELECT Id,AccountID,Number__c FROM Case  WHERE ID =:CaseId ];
Set<String> xxset = new Set<String>(); 
for (Case cs: Caslist) {
                xxset.add(cs.Number__c);
         }
          List<string> str = new List<string>();
          for (xxx__c xxinfo: [select id,Account__c,Case__c,Number__c from XXX__c where Number__c in :xxset]) { 
              str.add(xxinfo.Number__c);
              xxMap.put(str, xxinfo);
            }
if(Cas.Number__c!=null) {
            for (String num : Cas.Number__c.split(',') )
            {              
                if(num!=''  && !xxMap.containskey(num)) {   // Recieving error here  (Method does not exist or incorrect signature: void containskey(String) from the type Map<List<String>,XXX__c>)
}
}
}

Can someone correct me on what mistake i did in above snippet. 
                              string ffdate = program.ffExpireDate;  
                              system.debug('ffexpirydate'+ffdate);
                               date dt = date.parse(ffdate);
                               FF.Expiry_Date__c = dt; 
Getting Error :-   |FATAL_ERROR|System.TypeException: Invalid date: 30-Sep-2018

Log: 
|USER_DEBUG|[49]|DEBUG|ffexpirydate30-Sep-2018 
|FATAL_ERROR|System.TypeException: Invalid date: 30-Sep-2018
                               
xx__c obj = [select xxnumber from xx__c];
in obj i will get the xxnumber's with comma seperated values (xxnumber = 12345,6789,09876). Here i need to split the comma's and add only the numbers to the list.