Tuesday, August 28, 2012

Read / Write Files from document handling

Question:
How can you read / writes files from document handling?

Answer:

void fromFolderToDB(FilePath _path)
{
System.IO.DirectoryInfo         dir = new
System.IO.DirectoryInfo(_path);
System.IO.FileInfo[]            files;
System.IO.FileInfo              curFile;
System.Collections.IEnumerator  enumerator;
BinData                         binData;
DocuValue                       docuValue;
;
files = dir.GetFiles(_path);
enumerator = files.GetEnumerator();
while (enumerator.MoveNext())
{
curFile = enumerator.get_Current();
docuValue.clear();
binData.loadFile(curFile.get_FullName());   // get file content
docuValue.File      = binData.getData();
docuValue.FileName  = curFile.get_Name();
docuValue.insert(); // insert into DB
}
}
void fromDBToFolder(FilePath _path)
{
BinData                         binData;
DocuValue                       docuValue;
;
while select docuValue // load From DB
{
binData.setData(docuValue.File);
binData.saveFile(docuValue.FileName); // insert into file system
}
}
Make attention to CodeAccessPermission when reading/writing to file system
and when using CLR inside X++

Monday, August 13, 2012

CAL License or Server License for SQL Server in AX Environment

Question
Should we use CAL based licensing or server based licensing for SQL Server in AX Environment?

Answer
Please read the link from here

Wednesday, August 1, 2012

Matching Invoices to Portions of a Packing Slip

Question
Is there any way to find out invoices corresponding to individual packing slips


Answer
There is a link between InventTrans, CustInvoiceJourn and CustPackingSlipJour. This can be used to get the desired result. Also read this document.


Links
http://www.microsoft.com/en-us/download/details.aspx?id=23769