You need to sign in to do that
Don't have an account?
Vincent van Drunen Littel
Problems with a visualforce page
Hi I would like some help on this visual force page
what I need is to have a page that displays all contacts and their account next to each other.
with checkbox next to them to select them and add them as target (custom object) which has a trigger when contact is created a target is created with basic info.
the controller is
what I need is to have a page that displays all contacts and their account next to each other.
with checkbox next to them to select them and add them as target (custom object) which has a trigger when contact is created a target is created with basic info.
the controller is
public class ContactsController { public String selectedContactsIds { get; set; } public PageReference addContact() { return null; } public List contacts {get; set;} Map contactMap {get; set;} public string selectedContactIds {get; set;} string parentContactId; public ContactsController() // CHANGE THIS (SelectConcorrenteController TO ConcorrenteController) { parentContactId = ApexPages.currentPage().getParameters().get('accId'); contactMap = new Map([select Id, Name from Contact]); contacts = contactMap.Values(); } public PageReference addTargets() { List contactIds = selectedContactIds.split(','); List Targets = new List(); for (string s : contactIds) { Target__c Target = new Target__c(Target__c = parentContactId, Name = contactMap.get(s).Name); Targets.add(target); } if (Targets.size() > 0) { insert Targets; } string strPageRef = '"javascript:window.close();"'; return new PageReference(strPageRef); } }Visual force is
When i added it gives me the error
SObject row was retrieved via SOQL without querying the requested field: Contact.Account
When I added to Account.Name
contactMap = new Map([select Id, Name, Account.Name from Contact])
I received this error
Expression value does not resolve to a field
Error is in expression '{!con.Account}' in component in page contactsvf
If anyone would know how to fix this??
You need to make it as
Thanks,
Himanshu
All Answers
with following codes
Now i would like to get help with leaving it nicely organized so its alphabetically organized and has a search button..
Thanks in advance for the help
You need to make it as
Thanks,
Himanshu
Would you be able to help me with leaving it nicely organized so its alphabetically organized and has a search button..??