October 30th, 2009

You are currently browsing the articles from KomKid.Net written on October 30th, 2009.

Axapta : Get next number sequence

การเรียกใช้ Number sequence สำหรับ running no. ต่าง ๆ ทำได้โดยใช้คำสั่ง

NumberSeq::newGetNum(ProdParameters::numRefProdJournalId()).num();

ตรง Parameter ก็เปลี่ยนไปขึ้นอยู่ว่าเป็น Number sequence ของ Module ไหน
และจะใช้งานได้ Number sequence ต้องไม่ตั้งค่าให้เป็น Continuous

1
2
3
4
5
6
     JournalId          myJournalId;
      ;
     myJournalId = NumberSeq::newGetNum(ProdParameters::numRefProdJournalId()).num();
     myJournalId = NumberSeq::newGetNum(PurchParameters::numRefPurchaseOrderId()).num();
     myJournalId = NumberSeq::newGetNum(InventParameters::numRefInventJournalId()).num();
     myJournalId = NumberSeq::newGetNum(SalesParameters::numRefConfirmId()).num();

การตั้งค่า Number sequence ของแต่ละ module เข้าไปที่ Setup -> Parameters แล้วไปที่ tab Number sequences
ตรง Reference แต่ละตัวสามารถ คลิกขวา Go to the main table เพื่อตั้งค่ารูปแบบ Running number ที่ต้องการได้
Axapta_Setup_Number_Sequence
Axapta_Number_Sequence_Format

Written by Komkid on October 30th, 2009 with 2 comments.
Read more articles on Axapta and Programming.

Axapta : Formatting style in Excel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
static void ExcelFormating(Args _args)
{
    #Excel
 
    SysExcelApplication         excel;
    SysExcelWorkbooks           books;
    SysExcelWorkbook            book;
    SysExcelWorksheet           sheet;
    SysExcelRange               range;
    SysExcelStyles              styles;
    SysExcelStyle               style;
    SysExcelInterior            interior;
    SysExcelFont                font;
    COM                         _char, _r;
    ;
    excel       = SysExcelApplication::construct();
    excel.visible(true);
    books       = excel.workbooks();
    book        = books.add();
    sheet       = excel.activeSheet();
    range       = sheet.range('A1');
    styles      = book.styles();
    style       = styles.add('MyStyle');
    interior    = style.interior();
    interior.color(WinApi::RGB2int(246, 233, 206));
    font        = style.font();
    font.bold(true);
    font.color(winapi::RGB2int(153, 204, 255));
    range.style('MyStyle');
    range.locked(true);
    _r          = range.comObject();
    _char       = _r.characters(1);
    _char.insert('MyStyle');
 }

Written by Komkid on October 30th, 2009 with no comments.
Read more articles on Axapta and Programming.