You need to sign in to do that
Don't have an account?
RajaMohan
How to map the list and Id
Hi Folks,
How to map a ld with the list and display the same in the VF page??
For Eg:
Map<id,List<object__c>> obj=new Map<id,List<object__c>>();
Now, I want the fields in the object__c to be displayed in the VF page and want to update the same field via VF page.
Any examples will be helpful..
Thanks
Raj
Hi Friends,
The Following link helped me in doing the above things.
http://boards.developerforce.com/t5/Visualforce-Development/Display-data-from-multiple-objects-as-a-grid/m-p/165640/highlight/true
Thanks
Raj
All Answers
Can you be little more clear in what you want to get done?
To my understanding as of now, you should make use of Wrapper classes.
Hi Imran,
Thanks for your reply.
I am having 3 custom objects naming Project__c, Project_Resource__c and Project_Resource__Allocation__c. The Project is having the master relationship with Project Resource. The Project Resource is the master of Project Resource Allocation.
Now I am trying to map the Project Resource with the Project Resource Allocation from the master record Project.
I am mapping like Map<Id,List<Project_Resource__C>>.
I need to display the values of the Project Resource Allocation in the VF page for the different Project Record name. How to do this?? If I want to use the wrapper classes then give me an example of using that.
Thanks for your valuable contribution.
Thanks
Raj
Hi Friends,
The Following link helped me in doing the above things.
http://boards.developerforce.com/t5/Visualforce-Development/Display-data-from-multiple-objects-as-a-grid/m-p/165640/highlight/true
Thanks
Raj
I am getting the following error while saving the apex class:
Error: Compile Error: Loop variable must be an SObject or list of Attachment
please suggest...
I am using the following code:
public class Checkbox_Class
{
public class Attachmentwrapper
{
public Attachment acc{get; set;}
public Boolean selected {get; set;}
public Attachmentwrapper(Attachment a)
{
acc = a;
selected = false;
}
}
public Id oppr { get;set; }
public Checkbox_Class(ApexPages.StandardController ctrl)
{
oppr = ctrl.getRecord().Id;
}
List<Attachmentwrapper> AttachmentList = new List<Attachmentwrapper>();
List<Attachment> selectedAttachments = new List<Attachment>();
public List<Attachmentwrapper> getAttachments()
{
for (Attachment a : [select Id, Name, Body, BodyLength from Attachment where ParentId = :oppr])
{
AttachmentList.add(new Attachmentwrapper(a));
return AttachmentList;
}
}
public PageReference getSelected()
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[]{'SMaster@gmail.com'};
mail.setToAddresses(toAddresses);
mail.setReplyTo('SMaster@gmail.com');
mail.setSenderDisplayName('CRM Support');
mail.setBccSender(false);
mail.setUseSignature(false);
mail.setTargetObjectId('005Q0000000FR7f');
mail.setTemplateId('00XQ0000000QULj');
mail.saveAsActivity = false;
//selectedAttachments.clear();
for(Attachmentwrapper accwrapper : AttachmentList)
{
if(accwrapper.selected == true)
{
List<Messaging.Emailfileattachment> fileAttachments = new List<Messaging.Emailfileattachment>();
for (Attachment a : [select Id, Name, Body, BodyLength from Attachment where ParentId = :oppr])
{
Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
efa.setFileName(a.Name);
efa.setBody(a.Body);
fileAttachments.add(efa);
}
mail.setFileAttachments(fileAttachments);
selectedAttachments.add(accwrapper.acc);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
return null;
}
}
/* public List<Attachment> GetSelectedAttachments()
{
if(selectedAttachments.size()>0)
return selectedAttachments;
else
return null;
} */
}
}