static void Test_GetFileName(Args _args)
{
container segments, segmentReset;
str annotatedFormat, format;
CommaTextIo file;
container rec,filterCriteria;
Filename filename,filenamex;
int sep,i;
Dialog d;
DialogField df1;
Filename filepathz;
Filename filenamez;
Filename fileTypez;
str fileNameString;
;
d = new Dialog("Import Item Price Discount");
df1 = d.addField(ExtendedTypeStr("FilenameOpen"));
filterCriteria = ['*.txt','*.txt'];//// To filter only TXT files
filterCriteria = d.filenameLookupFilter(filterCriteria);
d.run();
if(d.run())
fileName = df1.value();
if(!fileName)
{
return;
}
filenamex = filename;
[filepathz, filenamez, fileTypez] = fileNameSplit(filenamex);
fileNameString= filenamez + fileTypez;
info(strFmt('Full path: %1',filenamex));
info(strFmt('File name: %1',fileNameString));
}
Tuesday, July 28, 2015
Cek Product yang sudah di-Release di Company yang berbeda - AX 2012
static void Test_Product_Find_CrossCompany(Args _args)
{
InventTable _inventTable;
ItemId itemidx;
SelectableDataArea dataAreaId1,dataAreaId2;
Dialog d;
DialogField df1;
CommaTextIo file;
container rec;
;
//info('Current company '+curext());
dataAreaId1 = curext();
d = new Dialog(strFmt("Find Exist Product",curext()));
df1 = d.addField(ExtendedTypeStr("ProductNumber"));
itemidx = df1.value();
if (d.run())
{
if(!df1.value())
{return;}
changeCompany('CMP1')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
changeCompany('CMP2')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
changeCompany('CMP3')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
}
}
{
InventTable _inventTable;
ItemId itemidx;
SelectableDataArea dataAreaId1,dataAreaId2;
Dialog d;
DialogField df1;
CommaTextIo file;
container rec;
;
//info('Current company '+curext());
dataAreaId1 = curext();
d = new Dialog(strFmt("Find Exist Product",curext()));
df1 = d.addField(ExtendedTypeStr("ProductNumber"));
itemidx = df1.value();
if (d.run())
{
if(!df1.value())
{return;}
changeCompany('CMP1')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
changeCompany('CMP2')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
changeCompany('CMP3')
{
if(InventTable::exist(df1.value())==true)
{ info('Exist in: '+curext()+', ItemGroupId: '
+InventItemGroupItem::findByItemIdLegalEntity(df1.value(),curext()).ItemGroupId); }
else
{ info('NOT Exist in '+curext()); }
}
}
}
Subscribe to:
Posts (Atom)