August 5th, 2009

You are currently browsing the articles from KomKid.Net written on August 5th, 2009.

Ubuntu : Create ISO image from CD/DVD or files

to make an ISO from your CD/DVD, place the media in your drive but do not mount it. If it automounts, unmount it. (ubuntu automount so you need to unmount, that’s quite easy, just choose the option unmount from the shell).

dd if=/dev/dvd of=dvd.iso # for dvd
dd if=/dev/cdrom of=cd.iso # for cdrom
dd if=/dev/scd0 of=cd.iso # if cdrom is scsi

To make an ISO from files on your hard drive, create a directory which holds the files you want. Then use the mkisofs command.

mkisofs -o /tmp/cd.iso /tmp/directory/

This results in a file called cd.iso in folder /tmp which contains all the files and directories in /tmp/directory/.

For more info, see the man pages for mkisofs, losetup, and dd, or see the CD-Writing-HOWTO at http://www.tldp.org.

Written by Komkid on August 5th, 2009 with no comments.
Read more articles on Ubuntu.

Axapta : Limited users sessions

แก้ startupPost method ใน Info class ดังนี้

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
35
    void startupPost()
    {
        int         counter;
        int         num = 0;
        int         maxSessions = Info::licensedUsersTotal();
        xSession    session;
        UserInfo    userInfo;
        UserId      currentUserId;
        ;

        currentUserId = curuserid();
        for(counter = 1; counter < maxSessions;counter++ )
        {
            session = new xSession(counter, true);
            if(session && session.userId())
            {
                select firstOnly userInfo
                    where userInfo.id == session.userId();

                if (userInfo && (currentUserId == session.userId()))
                {
                    num++ ;
                }
            }
        }

        if (num > 1)
        {
            if(box::yesno("The same user id can't log in twice. Do you want to log in anyway? ",
                       DialogButton::Yes, "Log in", "Log out") == DialogButton::No)
            {
                infolog.shutDown(true);
            }
        }
    }

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

Axapta : Modify lookup button

วิธีแก้ไขคอลัมน์ที่แสดงผลในปุ่ม Lookup ของ Axapta
หากต้องการแก้ไขคอลัมน์ที่แสดงผลใน Lookup (Drop Down) ของ Axapta ทำได้โดย
1.เข้าไปที่ Table ที่เป็น Data source ของ form นั้น
2.ในส่วนของ Field Groups ตรง AutoLookup ให้ลาก field ที่ต้องการให้แสดงผล ไปใส่ได้เลย

Written by Komkid on August 5th, 2009 with no comments.
Read more articles on Axapta.

Axapta : Refresh Data in grid

การ Refresh หรือ Update Data ใน grid ทำได้โดยเรียกใช้ method ของ datasource
ทำได้สองวิธี คือ
1.ใช้

1
xxx_ds.executeQuery()

วิธีนี้จะเป็นการ query ใหม่ ทำให้เสีย focus ไปจาก record เดิม แต่ข้อมูล update ทันที

2. ใช้

1
xxx_ds.reRead()

วิธีนี้จะเป็นการอ่านขึ้นมา record เดียวคือ record ที่เลือกอยู่ แต่จะไม่เห็นผลทันที ต้องเปลี่ยน record จึงจะเห็นผล

3.ใช้

1
2
3
xxx_ds.relead();
xxx_ds.research();
xxx_ds.findRecord();

เพื่อให้ record ที่ filter ไว้ยังคงอยู่ ดังตัวอย่าง

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
void clicked()
{
  PurchLine                 tmpPurchLine;
  PurchLine                 updatePurchLine;
  PurchLine                 selectedRecord;

  Dialog            dl;
  DialogField       dlfTransdate;
;

    dl  = new Dialog("Change confirmed date");
    dlfTransdate = dl.addFieldValue(typeid("Transdate"),today(),"Confirmed date");
    if(dl.run()){
        selectedRecord =  PurchLine_ds.cursor();
        for (tmpPurchLine = PurchLine_ds.getFirst(true) ? PurchLine_ds.getFirst(true) : PurchLine_ds.cursor();
        tmpPurchLine;    tmpPurchLine = PurchLine_ds.getnext())
        {
            ttsbegin;
            SELECT FORUPDATE updatePurchLine
             WHERE updatePurchLine.PurchId == tmpPurchLine.PurchId
                && updatePurchLine.VendAccount == tmpPurchLine.VendAccount
                && updatePurchLine.LineNum == tmpPurchLine.LineNum
                && updatePurchLine.ItemId == tmpPurchLine.ItemId;
            updatePurchLine.ConfirmedDlv = dlfTransdate.value();
            updatePurchLine.update();
            ttscommit;
        }
        PurchLine_ds.reread();
        PurchLine_ds.research();
        PurchLine_ds.findRecord(selectedRecord);
    }
    super();
}

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

Axapta : Array object

1
2
3
4
5
6
7
8
9
10
11
12
13
14
   array       i;
    int         n;
    ;

    i   = new array(types::String);

    i.value(1,"1.");
    i.value(2,"2.");
    i.value(3,"3.");
    i.value(4,"4.");


    for(n =1; n <= i.lastIndex(); n++)
            print i.value(n);

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

« Older articles

Newer articles »