Berikut ini code untuk buat item master, tapi belom ketemu untuk buat default Site & location nya....ada yang bisa bantu ?
static void Services_InventTable_Create(Args _args)
{
str inventdim;
str inventdimS;
str inventdimW;
InventDim _inventdim;
// Inventory Service class
InventItemService InventService;
InventItem Inventory;
// Data object of Service class
InventItem_InventTable InventTable;
InventItem_DefaultInventDimInventSetup InventDefault;
InventItem_DefaultInventDimPurchSetup PurchDefault;
InventItem_DefaultInventDimSalesSetup SalesDefault;
InventItem_InventItemInventSetup InventItemSetup;
AifEntityKeyList entityKeyList;
ItemId ItemId;
;
//Service instance
InventService = InventItemService::construct();
Inventory = new InventItem();
Inventory.createInventTable();
InventTable = Inventory.parmInventTable().addNew();
InventTable.parmItemId("1114");
InventTable.parmItemName("AUTO");
InventTable.parmItemGroupId("RM");
InventTable.parmDimGroupId("DIM02");
InventTable.parmModelGroupId("MED01");
// Create Inventory
entityKeyList = InventService.create(Inventory);
if(entityKeyList)
ItemId = entityKeyList.getEntityKey(1).parmKeyDataMap().lookup(fieldnum(InventTable, ItemId));
infolog.messageWin().addLine(ItemId);
}
{
str inventdim;
str inventdimS;
str inventdimW;
InventDim _inventdim;
// Inventory Service class
InventItemService InventService;
InventItem Inventory;
// Data object of Service class
InventItem_InventTable InventTable;
InventItem_DefaultInventDimInventSetup InventDefault;
InventItem_DefaultInventDimPurchSetup PurchDefault;
InventItem_DefaultInventDimSalesSetup SalesDefault;
InventItem_InventItemInventSetup InventItemSetup;
AifEntityKeyList entityKeyList;
ItemId ItemId;
;
//Service instance
InventService = InventItemService::construct();
Inventory = new InventItem();
Inventory.createInventTable();
InventTable = Inventory.parmInventTable().addNew();
InventTable.parmItemId("1114");
InventTable.parmItemName("AUTO");
InventTable.parmItemGroupId("RM");
InventTable.parmDimGroupId("DIM02");
InventTable.parmModelGroupId("MED01");
// Create Inventory
entityKeyList = InventService.create(Inventory);
if(entityKeyList)
ItemId = entityKeyList.getEntityKey(1).parmKeyDataMap().lookup(fieldnum(InventTable, ItemId));
infolog.messageWin().addLine(ItemId);
}
No comments:
Post a Comment