Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, August 20, 2015

X++ code to validate & post invent Journal in AX 2012

Hi,

static void AlfasithPostJournal(Args _args)
{ 
    InventJournalCheckPost      inventJournalCheckPost;
    InventJournalTable          inventJournalTable;
    ; 
    inventJournalTable = InventJournalTable::find("INV-0001245");
    inventJournalCheckPost = InventJournalCheckPost::newJournalCheckPost(JournalCheckPostType::Check, inventJournalTable);
    inventJournalCheckPost.parmThrowCheckFailed(true);
 // This true enable to prompt the error msg validate the journal
    try
    { 
        inventJournalCheckPost.run();
    }
    catch
    {
        info("The journal contains errors.");
    }
}
*************************************OR****************************************
static void AlfasithPostJournal(Args _args)
{ 
    InventJournalCheckPost      inventJournalCheckPost;
    InventJournalTable          journalTable;
    ; 
    journalTable= InventJournalTable::find("INV-0001245");
if(InventJournalCheckPost::newPostJournal(journalTable).validate()) InventJournalCheckPost::newPostJournal(journalTable).run();   
}

Regards,

Thursday, August 13, 2015

Creating a views in AX

Hi,

Create views 

  • Create new view
  • Metadata node, right-click on the Data Sources node and select new data source.
  • Change table property to the table name (parent).
  • In the ds of parent table create another ds and select table property as child table.
  • In the child table ds select yes to relation property.
  • Observe If you expand the Relations node you will find auto populated relation.

Regards,

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...