You need to sign in to do that
Don't have an account?
Rachid El Kaddouri
apex class fetch data from related list from Custom Object
Hi,
I'm stuck at this one. I'm trying to fetch fields from a related list but this ain't working for a custom object. This is my situation:
The Object Account has a related list that links to a child Custom Object named Account Locations. I want to fetch fields from this related list so I can show them in Google Maps as markers. This works for Contacts but for my custom object Account Locations this ain't working.
This is the controller:
Hope someone has a solution or idea for this.
Kind regards!
I'm stuck at this one. I'm trying to fetch fields from a related list but this ain't working for a custom object. This is my situation:
The Object Account has a related list that links to a child Custom Object named Account Locations. I want to fetch fields from this related list so I can show them in Google Maps as markers. This works for Contacts but for my custom object Account Locations this ain't working.
This is the controller:
public class AccountLocations { public Account AccountInformation {get; set;} public List<Account_Location__c> AllAccounts {get; set;} public AccountLocations(ApexPages.StandardController controller) { AccountInformation = (Account)controller.getRecord(); } public void fetchtAllRelatedAccountLocations(){ AllAccounts = [ SELECT Id, Location_Name__c, Location_Street__c, Location_Postal_Code__c, Location_City__c, Location_Country__c FROM Account_Location__c WHERE Id = :AccountInformation.Id ]; } }
Hope someone has a solution or idea for this.
Kind regards!
Thank you for the reply. When I want to save my visualforce page I get this error: Error: Unknown property 'AccountStandardController.Account_Location__c'
I want the page to show up in the Account Lay-Out therefore I need the standardcontroller in the vf page to be account and not account_location__c
Hope someone can help
Kind regards,
If it is wrong assumption please correct me when you get the answer.