• Joost Karsten
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I am querying a list of attachmens and displaying the list below the file upload section of the page. 

In the list I want a URL to view the file in a new window. (The built in RelatedList does not perform the same).

On the controller I attempt to get the URL with :

@RemoteAction
global static String getFileURL(String id){
try {
                   fileURL = URL.getFileFieldURL( id ,'AttachmentBody');
                   return fileURL;
}catch(Exception ex){
                   fileURL = ex.getMessage();
                   return fileURL;
}

}

The call to URL.getFileFieldURL fails with an Invalid Parameter value for the fieldName - this is exactly as per the documentation code

Any ideas would be helpful

thanks

Joe

 

  • August 12, 2013
  • Like
  • 0