DocuRef Table

Hi all, I have an ID to a record in the DocuRef Table. I need to open the document related to the record in DocuRef Table. Can someone please assist me in coming up with code that i can attach to a button that will allow me to open the document related to the DocuRef record. The document attached can be anything i.e Scanned document, pdf or Word document. Thank-you

For executing try WinApi: winapi::shellExecute All you have to do is to get the filename.

Thanks have attached code below I linked my table to the DocuRef’s RecID but i need the ValueRecId of DocuRef to connect to the DocuValue table which has details about the file. I also have a method in DocuValue that extracts the documents full path. display Filename completeFilename() { if (!this) return ‘’; return this.path()+this.fileName+’.’+this.fileType; } void clicked() { DocuValue docuValue; DocuRef docuRef; Filename filename; RecID _recID; ; docuRef = DocuRef::findRecId(MPBInterviewsToBeConducted.InterviewLetterDocID); _recID = docuRef.ValueRecId; docuValue = DocuValue::find(_recID); if (docuvalue) { filename = docuValue.completeFilename(); winapi::shellExecute(filename); } else { info(“No File attached”); } super(); }