以创建TransferOrder为例: static void createTransferOrder(Args _args) { InventJournalTable journalTable; InventJournalTrans journalTrans; InventJournalTableData journalTableData; InventJournalTransData journalTransData; InventTable inventTable; InventDim inventDim; InventJournalCheckPost journalCheckPost = new InventJournalCheckPost(); ; journalTableData = JournalTableData::newTable(journalTable); journalTransData = journalTableData.journalStatic().newJournalTransData(journalTrans, journalTableData); // Init journalTable journalTable.clear(); journalTable.JournalId = journalTableData.nextJournalId(); journalTable.JournalType = InventJournalType::Transfer; journalTable.JournalNameId = journalTableData.journalStatic().standardJournalNameId(journalTable.JournalType); journalTableData.initFromJournalName(journalTableData.journalStatic().findJournalName(journalTable.JournalNameId)); journalTrans.clear(); journalTransData.initFromJournalTable(); journalTrans.TransDate = systemdateget(); journalTrans.initFromInventTable(InventTable::find('1000')); journalTrans.Qty = 10; inventDim.clear(); inventDim.inventSiteId = '1'; inventDim.InventLocationId = '11'; journalTrans.InventDimId = InventDim::findOrCreate(inventDim).inventDimId; inventDim.clear(); inventDim.InventSiteId = '2'; inventDim.InventLocationId = '21'; journalTrans.ToInventDimId = InventDim::findOrCreate(inventDim).inventDimId; journalTransData.create(); journalTable.insert(); // post if (InventJournalCheckPost::newPostJournal(journalTable).validate()) { inventJournalCheckPost::newPostJournal(journalTable).run(); } }