Thursday 17 November 2011

Posting General Journal using code


How to do it...

  1. 1. Open AOT and create a new class called JournalPost with the following code (replace 000152_010 with your journal number):
    class JournalPost
    {
    }
    public static void main(Args _args)
    {
    LedgerJournalCheckPost jourPost;
    LedgerJournalTable jourTable;
    ;
    jourTable = LedgerJournalTable::find('000152_010');
    jourPost = LedgerJournalCheckPost::newLedgerJournalTable(
    jourTable,
    NoYes::Yes);
    jourPost.run();
    }
  2. 2. Run the class and notice the Infolog confirming that the journal was successfully posted:

Tuesday 1 November 2011

Coloring records in a Form

I was working on a request , where user want to have salesorder of having SalesStatus  cancel in Red color ,

I achieved this by overriding method Displayoption of datasource salestable as below :

public void displayOption(Common _record, FormRowDisplayOption _options)
{
    ;
    if(_record.(Fieldnum(salestable,salesstatus)) == SalesStatus::Canceled)
    {
        _options.backColor(WinAPI::RGB2int(255,100,100));
    }
    super(_record, _options);


Hope this will help , thanks
}