October 2009

You are currently browsing the articles from KomKid.Net written in the month of October 2009.

Axapta : Dialog with lookup control

วิธีสร้าง dialog แบบที่มี control ซึ่ง lookup ได้ เช่น เลือก SalesId แล้วให้อีก control นึง คือ ItemId lookup มาเฉพาะของ SalesId นั้น
dialog_with_lookup_control

ทำได้ดังนี้
1.declare control ไว้ ตาม extended data type ที่จะใช้

1
2
3
4
class LookupDialog extends RunBase
{
    FormStringControl   SalesIdCtrl, ItemIdCtrl;
}

2.สร้าง dialog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
protected Object dialog(Dialog dialog, boolean forceOnClient)
{
    DialogRunBase ret;
    ;
    ret = super(dialog, forceOnClient);
    ret.caption('Costing report by order');

    SalesIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'SalesId');
    SalesIdCtrl.extendedDataType(extendedTypeNum('SalesId'));


    ItemIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'ItemId');
    ItemIdCtrl.extendedDataType(extendedTypeNum('ItemId'));


    return ret;
}

3.Set ให้ control สามารถ override method ตอน runtime ได้

1
2
3
4
5
6
7
8
9
public void dialogPostRun(DialogRunbase dialog)
{
    ;
    super(dialog);
    dialog.dialogForm().formRun().controlMethodOverload(true);
    dialog.dialogForm().formRun().controlMethodOverloadObject(this);
    SalesIdCtrl = dialog.dialogForm().formRun().design().controlName('SalesId');
    ItemIdCtrl = dialog.dialogForm().formRun().design().controlName('ItemId');
}

4.สร้าง lookup method

1
2
3
4
5
6
7
8
9
10
11
12
void ItemId_lookup()
{
    Query                   query          = new Query();
    SysTableLookup          sysTableLookup =
    SysTableLookup::newParameters(tableNum(SalesLine), SalesIdCtrl);
    ;
    sysTableLookup.addLookupField(fieldNum(SalesLine, ItemId));
    sysTableLookup.addLookupField(fieldNum(SalesLine, Name));
    query.addDataSource(tableNum(SalesLine)).addRange(fieldNum(SalesLine,SalesId)).value(SalesIdCtrl.text());
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}

5.เก็บรายละเอียด method อื่น ๆ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public container pack()
{
    return conNull();
}

public boolean unpack(container packedClass)
{
    return true;
}

static void main(Args _args)
{
    LookupDialog test1 = new LookupDialog();
    ;
    if (test1.prompt())
    {
        test1.run();
    }
}

ที่มา :

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

OpenOffice : Double line style

วิธีขีดเส้นใน OpenOffice ให้มี 2 เส้น ทำได้ดังนี้
1.ใช้เครื่องมือลากเส้น (Line ใน Drawing toolbar) ขีดไว้ แล้วคลิกขวาที่ เส้น เลือก Line…
openoffice_drawing_toolbar
2.คลิกที่ tab Shadow แล้วติ๊กที่ Use shadow
3.เลือกตำแหน่ง ,ระยะห่างระหว่างเส้นและสีของเส้นที่ 2
openoffice_line _shadow

Written by Komkid on October 9th, 2009 with no comments.
Read more articles on OpenOffice.

Solve Host to IP without DNS

แปลง Host เป็น IP โดยไม่ต้องพึ่ง DNS Server ทำได้โดย ระบุในไฟล์ ชื่อ hosts
ของ Windows อยู่ที่ C:\WINDOWS\system32\drivers\etc\hosts
ของ linux อยู่ที่ /etc/hosts

รูปแบบคือ
IP ช่องว่างตามด้วย host

ตัวอย่างของ Windows

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

อันนี้ของ linux

192.168.0.250 IF-Nikom.sci.com IF-Nikom
192.168.0.1 axaptaserver.sci.com axaptaserver
192.168.0.251 server1.sci.com server1
192.168.0.252 server2.sci.com server2
192.168.0.253 server3.sci.com server3

ตามหลักการก็น่าจะเร็วกว่าการใช้ dns ด้วย เพราะไม่ต้องวิ่งผ่าน server

Written by Komkid on October 4th, 2009 with no comments.
Read more articles on IT Tips and Networking.

GeSHi Language Aliases

ทั้ง phpBB ของที่ทำงานและ wordpress ของที่นี่ ต่างก็ใช้ Syntax Hilight ของ GeSHi
โดย phpBB เป็น phpBB3.0.5 ติดตั้ง mod bbGeSHi 0.7.5
และ wordpress ใช้ plugin wp-syntax.0.9.8
เวลาใช้มักจะลืมตัวย่อของภาษาอยู่เรื่อย ก็เลยต้อง list ไว้กันลืมซะหน่อย
ABAP – abap
Actionscript – actionscript
ADA – ada
Apache Log – apache
AppleScript – applescript
APT sources.list
ASM (m68k) – asm
ASM (pic16) – asm
ASM (x86) – asm
ASM (z80) – asm
ASP – asp
AutoIT – autoit
Backus-Naur form
Bash – bash
Basic4GL
BlitzBasic – blitzbasic
Brainfuck – bnf
C – c
C for Macs – c_mac
C# – cpp
C++ – csharp
C++ (with QT) – cpp-qt
CAD DCL – caddcl
CadLisp – cadlisp
CFDG – cfdg
CIL / MSIL
COBOL
ColdFusion – cfm
CSS – css
D – d
Delphi – delphi
Diff File Format – diff
DIV – div
DOS – dos
DOT language – dot
Eiffel – eiffel
Fortran – fortran
FourJ’s Genero – genero
FreeBasic – freebasic
GetText
glSlang
GML – gml
gnuplot
Groovy – groovy
Haskell – haskell
HQ9+
HTML – html, html4strict
INI (Config Files) – ini
Inno – inno
INTERCAL
IO – io
Java – java
Java 5 – java5
Javascript – javascript, js
KiXtart
KLone C & C++
LaTeX – latex
Lisp – lisp
LOLcode
LotusScript
LScript
Lua – lua
Make – m68k
mIRC – mirc
MXML
MySQL – mysql
NSIS – nsis
Objective C – objc
OCaml – Ocaml-brief, ocaml
OpenOffice BASIC – oobas
Oracle 8 & 11 SQL – oracle8
Pascal – pascal
Perl – perl
PHP – Php-brief, php
Pixel Bender
PL/SQL – plsql
POV-Ray
PowerShell
Progress (OpenEdge ABL)
Prolog
ProvideX
Python – python
Q(uick)BASIC – qbasic
robots.txt – robots
Ruby – ruby
Ruby on Rails – rails
SAS – sas
Scala
Scheme – scheme
Scilab
SDLBasic – sdlbasic
Smalltalk – smalltalk
Smarty – smarty
SQL – sql
T-SQL – tsql
TCL – tcl
thinBasic – thinbasic
TypoScript
Uno IDL
VB.NET – vbnet
Verilog
VHDL – vhdl
VIM Script
Visual BASIC – vb
Visual Fox Pro – visualfoxpro
Visual Prolog
Whitespace
Winbatch – winbatch
Windows Registry Files – reg
X++ – xpp (มี X++ ของ Axapta ด้วย)
XML – xml, xsl
Xorg.conf

Written by Komkid on October 4th, 2009 with no comments.
Read more articles on Admin and Internet.

No older articles

Newer articles »