• Salesforce Developer 109
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
The use case is Account records are connected to other account records using hierarchial relationship. How can i show its child accounts contact records on the parent account page?
Example: Account A- Parent , Account B-Child to A, Account C- Child to A,

How can i display (using VF) on the account A the contact records of Account B and C?
what is the relationship name to query an account itself when in hierarchy relationship?
Any help is highly appreciated.
i am trying to build a lightning component that shows nearby contacts based on the users current location. i am getting an error when trying to access the users current location through navigator.geoLocation. I get the following error.
"Uncaught error in actionCallback : navigator.geoLocation is undefined"

Here is my component and its controller logic.

Component:
<aura:component >
    
   <aura:attribute name="latitude" type="Decimal"/>
    <aura:attribute name="longitude" type="Decimal"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
  
</aura:component>
Controller:
({
	doInit : function(component, event, helper) {
        if(navigator.geoLocation){
            console.log("capability is there");
            
        }else{
            console.log("No Capability");
        }
        navigator.geoLocation.getCurrentPosition(function(position){
            this.latitude=component.set("v.latitude",position.coords.latitude);
            this.longitude=component.set("v.longitude", position.coords.longitude);
            console.log("Latitude is:"+this.latitude);
            console.log("Longitude is:" +this.longitude);
        });
		
	}
})
debugging  console log shows that my else part is only written to console. does that mean that geolocation is not supported in lightning? Am i doing anything wrong ? Any help would be appreciated.