Class
private List<Contact> RepCombinedAttachment;
Public List<CombinedAttachment> RepComAttachment;
public List<CombinedAttachment> getRepComAttachment() {
return RepComAttachment;
}
public CombinedAttachmentcont(ApexPages.StandardController controller) {
ViewData();
}
public void ViewData()
{
RepCombinedAttachment = Database.query('Select (Select id, title, LastModifiedDate,
createdby.name,RecordType From CombinedAttachments) from Contact where ID=:id');
for (Contact c : RepCombinedAttachment)
{
for(CombinedAttachment temp : c.CombinedAttachments)
{
if(!temp.isEmpty())
RepComAttachment.add(temp);
}
}
}
Error Message:
Compile Error: Method does not exist or incorrect signature: [CombinedAttachment].isEmpty()
Could someone please help me fix this issue.
Best Answer
isEmpty()
is the list class method in order to check sobject. You may want to use any field is null or notremove
if(!temp.isEmpty())
Edit
in constructor