Показать сообщение отдельно
Старый 29.12.2007, 19:50   #1  
Blog bot is offline
Blog bot
Участник
 
23,271 / 788 (73) +++++++
Регистрация: 28.10.2006
Ruslan Goncharov: How to add a document into AX programmically? (Document handling)
Источник: http://rusgon.blogspot.com/2007/12/h...t-into-ax.html
==============

As a matter of fact it's pretty easy.
Following lines allow you do this.

X++:
void saveIntoDocuRefTable()
{
    DocuValue docuValue;
    DocuRef docuRef;
    Container cFile;
 
    BinData binData;
    DocuTypeId _docuTypeId = ...;
    ;
 
    binData = new BinData();
    binData.loadFile(fileName);
 

    cFile = Docu::splitFileName(fileName);
    docuValue.fileName = conpeek(cFile,1);
    docuValue.path = conpeek(cFile,3);
    docuValue.fileType = conpeek(cFile,2);
    docuValue.File = binData.getData();
    docuValue.insert();
 

    docuRef.ValueRecId = docuValue.recId;
    docuRef.RefCompanyId = CurExt();
    docuRef.RefTableId = tableNum(....);
    docuRef.RefRecId = .....;
    docuRef.TypeId = _docuTypeId;
    docuRef.Name = fileName;
    docuRef.Notes = ....;
    docuRef.insert();
 
    WinApi::deleteFile(fileName);
}

Источник: http://rusgon.blogspot.com/2007/12/h...t-into-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.