Показать сообщение отдельно
Старый 29.11.2016, 19:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
How to see beginning balance journals from your projects
Источник: http://alexvoy.blogspot.com/2016/11/...-journals.html
==============

There is a bug in AX 2012 R2/R3.

Beginning balance journals do not create transactions in ProjJournalTrans table; therefore, they won't be selected via the standard query.



This is a small fix to show beginning balance journals from the projects forms.

In ProjJournalFormTable class we need to redo datasourceLinkActivePre() method as follows:

public void datasourceLinkActivePre()
{
QueryBuildDataSource qbds;
ProjTable callerRecord;

if (formRun &&
formRun.args() &&
formRun.args().record() &&
formRun.args().dataset() == tableNum(ProjTable))
{
callerRecord = formRun.args().record() as ProjTable;

// if this is a beginning balance table we have no transactions in ProjJournalTrans
// therefore, we need to update the query so that all related journals will be shown.
if(journalTypeId == 2) // beginning balance
{
SysQuery::findOrCreateRange(journalTable_ds.query().dataSourceTable(tableNum(ProjJournalTable)), fieldNum(ProjJournalTable, JournalType)).value(SysQuery::value(ProjJournalType::BegBalance));
SysQuery::findOrCreateRange(journalTable_ds.query().dataSourceTable(tableNum(ProjJournalTable)), fieldNum(ProjJournalTable, ProjId)).value(SysQuery::value(callerRecord.ProjId));
}
else
{
// End
qbds = journalTable_ds.query().dataSourceNo(1).addDataSource(tableNum(ProjJournalTrans));

qbds.joinMode(JoinMode::ExistsJoin);

qbds.addRange(fieldNum(ProjJournalTrans, ProjId)).value(callerRecord.ProjId);
qbds.relations(true);
}
}

super();
}


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