Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class downloadAttachment {
- String recId;
- public downloadAttachment(ApexPages.StandardController controller) {
- recId = controller.getId();
- }
- public List<String> getfieldId() {
- List<String> li = new List<String>();
- System.debug(li.isEmpty()); // true
- List<Attachment> attachedFiles = [select Id from Attachment where parentId =:recId order By LastModifiedDate DESC ];
- if( attachedFiles != null && attachedFiles.size() > 0 ) {
- for (Integer i=0 ; i < attachedFiles.size(); i++) {
- fieldId.add(attachedFiles[i].Id);
- }
- }
- return fieldId;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement