Below is the code for getting the unused project dimensions in AX.
Note : Please create a table(Test) with two string fields.
Note : Please create a table(Test) with two string fields.
static void ProjCategory(Args _args)
{
ProjUnpostedTransView projUnpostedTransView;
ProjPostTransView projPostTransView;
CategoryTable categoryTable;
Test test;
int iCounter;
delete_from test;
while select * from categoryTable
{
test.clear();
select firstOnly projPostTransView where projPostTransView.CategoryId == categoryTable.CategoryId;
if(projPostTransView)
{
continue;
}
// else if(!projPostTransView)
// {
select firstonly projUnpostedTransView where projUnpostedTransView. CategoryId == categoryTable.CategoryId;
if(projUnpostedTransView)
{
continue;
}
else
{
test.AccountNum = categoryTable.CategoryId;
test.Name = categoryTable.CategoryName;
test.insert();
iCounter++;
}
SQL Query:
select * from CATEGORYTABLE where not exists
( select * from projPostTransView where CATEGORYTABLE.CategoryId = projPostTransView.CategoryId) and
not exists (select * from ProjLedgerJournalTransUnpostedView where CATEGORYTABLE.CategoryId = ProjLedgerJournalTransUnpostedView.CATEGORYID)
@Rahul Talasila
No comments:
Post a Comment