Показать сообщение отдельно
Старый 16.08.2007, 10:54   #2  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
А в системе примеры кто искать будет?

\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;
}
За это сообщение автора поблагодарили: Eldar9x (1).