А в системе примеры кто искать будет?
\Data Dictionary\Tables\DocuValue\Methods\writeDocuValue
X++:
public static docuValue writeDocuValue(DocuRef docuRef,
FileName fileName = '',
BinData binData = NULL
)
{
DocuValue docuValue;
DocuType docuType;
;
ttsbegin;
docuType = docuRef.docuType();
docuValue = docuRef.docuValue(true);
[docuValue.fileName, docuValue.fileType, docuValue.path] = Docu::splitFilename(fileName);
if (docuType.filePlace != DocuFilePlace::NoCopy)
docuValue.path = ''; //path is already stored in ArchivePath in docuType or docuParameters
if (docuType.filePlace == DocuFilePlace::Database)
{
// Insert to database
if (WinApi::fileLocked(fileName))
{
info("@SYS72783",'',SysInfoAction_formRun::newFormname(formstr(DocuOpenFile), identifierstr(Grid), "@SYS4167"));
}
else
{
if (! binData)
{
binData = new BinData();
if (binData.loadFile(fileName)) //only works if file not locked
{
docuValue.file = binData.getData();
}
else
throw error(strFmt("@SYS54217",fileName));
}
else
docuValue.File = binData.getData();
}
}
docuValue.update();
ttscommit;
return docuValue;
}