Friday, February 12, 2010

Axapta : Posting journal by code


static void InventJournalCheckPost(Args _args)
{
InventJournalTable inventJournalTable;
InventJournalCheckPost journalCheckPost;
;
ttsbegin;
inventJournalTable = InventJournalTable::find("xxx",true);
//Remove Journal "xxx" has not been locked by system
inventJournalTable.SystemBlocked = true;
inventJournalTable.update();

journalCheckPost = InventJournalCheckPost::newJournalCheckPost (JournalCheckPostType::Post,inventJournalTable);
journalCheckPost.run();

inventJournalTable.SystemBlocked = false;
inventJournalTable.update();
ttscommit;
}

No comments: