• Rick Blake
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 1
    Replies
I'm trying to get a list 'oppsToLock', which are opportunities from 'opps' that are not locked.
But this code is giving me a runtime error:

System.TypeException: Invalid conversion from runtime type Set<String> to Set<Id>

Approval.isLocked() is supposed to return a map of Id and true/false so why doesn't this work?

List<Id> oppsToLock = new List<Id>();
Map<Id,Boolean> mapLocks = Approval.isLocked(opps);
for(Id oppId : mapLocks.keySet()){
    if(mapLocks.get(oppId)==false){
        oppsToLock.add(oppId);
    }
}
I found an error in a Trailhead, thought I'd help anyone else with the same problem. While trying to solve the Using Events to Add Markers to the Map section of the Build an Account Geolocation App trailhead I kept receiving an error about a null value. Debugging the code I found that the map variable in AccountMapController.js was null. This is because the accounts were loading faster than the Leaflet.js libraries. To get around this I changed the accountsLoaded function to recursively check if the map existed only add markers once the map was an object:

   if(component.get("v.map") != null){
            var map = component.get("v.map");

            alert(map);
            
            var accounts = event.getParam("accounts");
            for (var i=0; i<accounts.length; i++) {
                var account = accounts[i];
                var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
                L.marker(latLng, {account: account}).addTo(map);
            }  
        }else{
            accountsLoaded(component, event, null); 
        }
I found an error in a Trailhead, thought I'd help anyone else with the same problem. While trying to solve the Using Events to Add Markers to the Map section of the Build an Account Geolocation App trailhead I kept receiving an error about a null value. Debugging the code I found that the map variable in AccountMapController.js was null. This is because the accounts were loading faster than the Leaflet.js libraries. To get around this I changed the accountsLoaded function to recursively check if the map existed only add markers once the map was an object:

   if(component.get("v.map") != null){
            var map = component.get("v.map");

            alert(map);
            
            var accounts = event.getParam("accounts");
            for (var i=0; i<accounts.length; i++) {
                var account = accounts[i];
                var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
                L.marker(latLng, {account: account}).addTo(map);
            }  
        }else{
            accountsLoaded(component, event, null); 
        }
Hi Guys,
I'm trying to complete this challenge, but I don't understand the error I have.
I've created "myFirstComponent" with the following on their .cmp file:
<aura:component >
	 I am proficient in JavaScript
</aura:component>
After that I've created the "harnessApp" Lightning Application with this on it:
<aura:application >
	<c:myFirstComponent />
</aura:application>
And the error is ... 
Error trying to check the challenge

Any help on that ?
Thanks.
Hi Guys,
I'm trying to complete this challenge, but I don't understand the error I have.
I've created "myFirstComponent" with the following on their .cmp file:
<aura:component >
	 I am proficient in JavaScript
</aura:component>
After that I've created the "harnessApp" Lightning Application with this on it:
<aura:application >
	<c:myFirstComponent />
</aura:application>
And the error is ... 
Error trying to check the challenge

Any help on that ?
Thanks.