AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 28.11.2012, 12:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Join Date: 28.10.2006
Malaysia: Processing a project journal
Источник: http://axmas.blogspot.com/2012/11/pr...t-journal.html
==============


1. In the AOT, create a new job named ProjJournalCreate with the following code:

static void ProjJournalCreate(Args _args)
{
ProjJournalTable jourTable;
ProjJournalTrans jourTrans;
ProjJournalTableData jourTableData;
ProjJournalTransData jourTransData;
ProjJournalStatic jourStatic;
ttsBegin;
jourTableData = JournalTableData::newTable(jourTable);
jourTable.JournalId = jourTableData.nextJournalId();
jourTable.JournalType = ProjJournalType::Hour;
jourTable.JournalNameId = 'Hours';
jourTableData.initFromJournalName(ProjJournalName::find(jourTable.JournalNameId));
jourStatic = jourTableData.journalStatic();
jourTransData = jourStatic.newJournalTransData(jourTrans, jourTableData);
jourTransData.initFromJournalTable();
jourTrans.initValue();
jourTrans.ProjId = '10001';
jourTrans.initFromProjTable(ProjTable::find(jourTrans.ProjId));

jourTrans.TransDate = systemDateGet();
jourTrans.ProjTransDate = jourTrans.TransDate;
jourTrans.CategoryId = 'Design';
jourTrans.setHourCostPrice();
jourTrans.setHourSalesPrice();
jourTrans.TaxItemGroupId = ProjCategory::find(jourTrans.CategoryId).TaxItemGroupId;
jourTrans.Worker = HcmWorker::findByPersonnelNumber('000062').RecId;
jourTrans.Txt = 'Design documentation';
jourTrans.Qty = 8;
jourTransData.create();
jourTable.insert();
ttsCommit;
info(strFmt("Journal '%1' has been created", jourTable.JournalId));
}

2. Run the job and check the results by going to Project management and accounting | Journals | Hour:




3. Click on the Lines button to open the journal lines, and notice the newly
created record:







Источник: http://axmas.blogspot.com/2012/11/pr...t-journal.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
Malaysia: Posting a general journal Blog bot DAX Blogs 0 27.11.2012 15:11
Malaysia: Creating a general journal Blog bot DAX Blogs 0 27.11.2012 15:11
dynamicsaxtraining: Purchase Blog bot DAX Blogs 0 11.03.2012 05:25
Microsoft Dynamics CRM Team Blog: Fast, Efficient Growth for Project Management Solution - Case Studies Blog bot Dynamics CRM: Blogs 0 01.02.2012 03:18
chrisfie: Project Server 2007 TechNet Webcasts recordings and decks Blog bot DAX Blogs 0 21.07.2009 10:05

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 01:49.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.