我需要以任何形式将附件的内容复制到 AX2012 中的特定记录,然后我必须将此内容粘贴到同一表单下的任何字符串类型字段中。
我正在尝试执行此操作:
public void getdocucontent()
{
Dev_ManageTemplates obj_Dev_ManageTemplates;
DocuRef obj_docuRef;
DocuValue obj_DocuValue;
RecId recid;
TextIo txIoRead,
txIoWrite;
FileIOPermission fioPermission;
TextBuffer txtb;
container containFromRead;
int xx,num,
iConLength;
str sTempPath,
sFileName, completename ;
str 64 s1;
;
Dev_ManageTemplates_ds.getFirst(true);
recid = Dev_ManageTemplates.RecId;
select obj_docuRef
where obj_docuRef.RefRecId == recid;
select obj_DocuValue
where obj_DocuValue.name == obj_docuRef.Name;
sTempPath = obj_docuRef.path();
sFileName = obj_DocuValue.FileName;
completename = sTempPath+sFileName+"."+obj_DocuValue.FileType;
fioPermission = new FileIoPermission("completename",'r');
txtb = new TextBuffer();
fioPermission.assert();
txtb.fromFile("completename"); // Read text from file
//txtb.toString(); // Copy it to the clipboard
// StringEdit.text(txtb.getText());
s1 = txtb.getText();
// info(txtb.getText());
}