zoukankan      html  css  js  c++  java
  • How to Create Screen/Window in ADempiere

    1 – Create database table by executing your script. For example:

    CREATE TABLE "ITC_EMPLOYEE"
    ( "ITC_EMPLOYEE_ID" NUMBER(10,2) NOT NULL ENABLE,
    "NAME" VARCHAR2(50) NOT NULL ENABLE,
    "FATHERNAME" VARCHAR2(50),
    "AD_CLIENT_ID" NUMBER(10,0) NOT NULL ENABLE,
    "AD_ORG_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ISACTIVE" CHAR(1) DEFAULT 'Y' NOT NULL ENABLE,
    "CREATED" DATE DEFAULT SYSDATE NOT NULL ENABLE,
    "CREATEDBY" NUMBER(10,0) NOT NULL ENABLE,
    "UPDATED" DATE DEFAULT SYSDATE NOT NULL ENABLE,
    "UPDATEDBY" NUMBER(10,0) NOT NULL ENABLE,
    CONSTRAINT "ITC_EMPLOYEE_PK" PRIMARY KEY ("ITC_EMPLOYEE_ID") ENABLE
    );

    Following are the important point about database table:

    • It is better to create primary-key (PK). The PK name should be: [table name] + “_ID” and type should be NUMBER if you want to leverage with full ADempiere AD features.
    • Along with PK there should be 7 other fields: •AD_CLIENT_ID •AD_ORG_ID •ISACTIVE •CREATED •CREATEDBY•UPDATED •UPDATEDBY


    2 – Activating the new table in the AD
    Now we have to import that new table in ADempiere - here we again call it a Table :)

    • · Login as System administrator in ADempiere. The user id and password is: SuperUser/System
    • · Open ‘Table and Column’ window
    • · Create a new record
    • · Type into DB Table Name, the name of the newly created DB-table i.e ITC_EMPLOYEE
    • · Set ‘Data Access Level’ to ‘All’ and check the item ‘Maintain Change Log’
    • · Click on the button Create Columns from DB.

    o This creates for each db-tablecolumn a corresponding AD Column.
    o Check the automatic created Columns, especially the ID references (e.g. Number instead of Integer)


    Now you can say that we have a physical database table that we created in step 1 & and we have an ADempiere logical table created in Step 2. First one is DB table and second one is AD table.

    3 –Create an ADempiere window

    • · Create a new entry in the ‘Window Tab & Field’ with the name ITC_EMPLOYEE . In the next tab i.e. ‘Tab’ create a new entry with the name EMPLOYEE and select ‘ITC_EMPLOYEE’ as it's table.
    • · Use the button ‘Create Fields’ to create fields for all columns of the table. In the tab ‘Field Sequence’ you can choose the sequence of the fields in the new window and in the tab ‘Field’ you can select some view-related attributes. Set the read-only flag for ‘ITC_EMPLOYEE _ID’ (the id should be unchangeable).
    • · To change the display properties (read-only, displayed or mandatory) of any fields see Display properties of columns and fields for more details.

    4 – Create a MENU and attach your window with it. It's for your exercise.

  • 相关阅读:
    11.重写、抽象、接口、异常
    3.用户组、指令运行级别、帮助指令、文件目录类(一)
    2.vi和vim编辑器、vi和vim三种模式、vi和vim快捷键、关机、重启命令、用户管理
    1.VM和Linux系统(centos)安装、linux目录结构、远程登录到Linux服务器、远程上传下载文件xftp
    10.函数、流程控制
    9.变量、存储过程
    8.事务、视图
    7.库和表的管理、常见数据类型、常见约束、标识符
    CH6801 棋盘覆盖(二分图最大匹配)
    洛谷P1525 关押罪犯(二分图判定+二分)
  • 原文地址:https://www.cnblogs.com/eastson/p/2631620.html
Copyright © 2011-2022 走看看