Berikut ini digunakan untuk melakukan insert data ke 2 company dengan menggunakan class.
Syntax nya changeCompany("HSP").
static void Create_to_2Company(Args _args)
{
AxPurchTable table;
AxPurchLine line;
;
table = new AxPurchTable();
table.parmOrderAccount('');
table.parmInventLocationId('WAREHOUSE');
table.save();
line = new AxPurchLine();
line.axPurchTable(table);
line.parmItemId('A001'); // Item number Q987
line.parmPurchQty(12); // 12 pcs.
line.save();
changeCompany("HSP")
{
table = new AxPurchTable();
table.parmOrderAccount('');
table.parmInventLocationId('WAREHOUSE');
table.save();
line = new AxPurchLine();
line.axPurchTable(table);
line.parmItemId('A001'); // Item number Q987
line.parmPurchQty(12); // 12 pcs.
line.save();
}
}
Sunday, March 18, 2012
Monday, March 5, 2012
Lookup modifikasi
Berikut ini digunakan untuk membuat lookup sendiri. Kasusnya, nambah form dan EditString, namun tidak ada relasi ke datasource (EdiString lepasan gitu.....)
public void lookup()
{
//super();
//Inisialisasi sysTableLookupClass
sysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventItemgroup), this);
Query query = New Query();
QueryBuildDataSource qbdsTbl1, qbdsTbl2;
QueryBuildRange qbr;
;
//Tambah tabel
qbdsTbl1 = query.addDataSource(tableNum(InventItemgroup));
//Tambah rentang Query untuk membatasi daftar record
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,ItemGroupId));
qbr.value();
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,Name));
qbr.value();
qbdsTbl1.relations(true);
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, ItemGroupId));
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, Name));
sysTableLookup.parmQuery(query);
//Tampilkan drop down
sysTableLookup.performFormLookup();
}
public void lookup()
{
//super();
//Inisialisasi sysTableLookupClass
sysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventItemgroup), this);
Query query = New Query();
QueryBuildDataSource qbdsTbl1, qbdsTbl2;
QueryBuildRange qbr;
;
//Tambah tabel
qbdsTbl1 = query.addDataSource(tableNum(InventItemgroup));
//Tambah rentang Query untuk membatasi daftar record
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,ItemGroupId));
qbr.value();
qbr = qbdsTbl1.addRange(fieldNum(InventItemgroup,Name));
qbr.value();
qbdsTbl1.relations(true);
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, ItemGroupId));
sysTableLookup.addLookupfield(fieldNum(InventItemgroup, Name));
sysTableLookup.parmQuery(query);
//Tampilkan drop down
sysTableLookup.performFormLookup();
}
Subscribe to:
Posts (Atom)