Controller: public class DocumentListExtension { public Resume__c Res{get;set;} public List<Document> DocList{get;set;} public DocumentListExtension(ApexPages.StandardController controller) { Res=(Resume__c)controller.getRecord(); String newSearchText = '%'+Res.Unique_Number__c+'%'; DocList=new List<Document>([select id,Name,CreatedDate from Document where Name like :newSearchText]); }
Could you please share your code.
Thanks,
Harshit Garg
public class DocumentListExtension {
public Resume__c Res{get;set;}
public List<Document> DocList{get;set;}
public DocumentListExtension(ApexPages.StandardController controller) {
Res=(Resume__c)controller.getRecord();
String newSearchText = '%'+Res.Unique_Number__c+'%';
DocList=new List<Document>([select id,Name,CreatedDate from Document where Name like :newSearchText]);
}
}
VF Page::
<apex:page standardController="Resume__c" extensions="DocumentListExtension" showHeader="false" sidebar="false" > <apex:form > <apex:inputHidden value="{!Resume__c.id}"/> <apex:inputHidden value="{!Resume__c.Unique_Number__c}"/> </apex:form> <apex:pagemessage severity="INFO" rendered="{!DocList.Size == 0}">No Resume Uploaded...</apex:pagemessage> <apex:pageBlock title="Your Resumes" id="block" rendered="{!!(DocList.Size == 0)}" > <apex:pageBlockTable value="{!DocList}" var="doc" > <apex:column headerValue="Resume Name" Title="Resume" > <apex:outputLink value="/{!doc.Id}" target="_blank" >{!doc.Name}</apex:outputLink> </apex:column> <apex:column headerValue="Updated Time" value="{!doc.CreatedDate}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>