返回列表 发帖

[PU9功能解说] 在Sage X3中如何用Tableaux编写代码?

TABLEAUX – Sage X3

在Sage X3中,TABLEAUX是另一种在编写最少代码行的情况下执行数据的方式。但TABLEAUX只能用于对象管理型的窗体。

下面我们演示了TABLEAUX创建、修改和删除。

步骤:

第1步:创建两个不同的表,一个是表头表,另一个是明细表。

第2步:创建两个屏幕,一个是表头屏幕,另一个是明细屏幕。

第3步:为对象和编码部分创建一个新的窗体。

第4步:在功能中修改和删除记录。

创建表:下面是我们创建的两个表。

表头表:


表索引:


明细表:


表索引:


在创建了表头,表屏幕和窗体之后,还必须创建以下组件。

对象:


如下图所示:


编码部分:
##################################################################$ACTION
    Case ACTION
        When “OUVRE”           :  Gosub $OUVRE
        When “LIENS”             :  Gosub $LIENS
        When “CREATION”    :  Gosub $CREATION
        When “MODIF”            :   Gosub $MODIF
        When “DEFLIG”          :   Gosub $DEFLIG
        When “FILTRE”           :  Gosub $FILTRE
        When “INICRE”            :  Gosub $INICRE
        When “INICRE_LIG”   :  Gosub $INICRE_LIG
        When “ANNULE”          :  Gosub $ANNULE
        When “VERIF_CRE”    :  Gosub $VERIF_CRE
        When Default
    Endcase
Return
##################################################################
### The tables declared in Object management are open to make the declarations of the resources required and for the initializations############
$OUVRE
   If !clalev([F:YXD]) : Local File YVXNUMD[F:YXD] : Endif  ##Details table
   If !clalev([F:YVH]) : Local File YVKNUMH[F:YVH] : Endif##Header table
    Gosub DECLARE From TABLEAUX ##Declare tables to TABLEAUX
Return
#################################################################
##### It is used in creating transaction, just before writing the instruction########
$INICRE
    [F:YXD]YXNUM=[M:YVX0]YXNUM                                    
Return
###############################################################
###Increment of line number#########################
$INICRE_LIG     
    [F:YXD]YXNUM=[M:YVX0]YXNUM
Return
################################################################## ##The line that defines the filter that is used to only read the detail lines attached to the current header ########
$DEFLIG                                                                  
    Default Mask [YVX1]                                                ####Details Screen
    Default File [YXD]                                                     ####Details Table abbre
    CRIT = ‘YXNUM=”‘+[M:YVX0]YXNUM+'”‘      ####Parameters
    FICLIG = “YVXNUMD”                                         ####Details Table
    ABLIG = “YXD”                                                       ####Details Table abbre
    ZONLIG = “YXNUMLIN”                                      ####Line no
Return
##################################################################
####### This is used to filter the elements in the principal and last read lists #########
$FILTRE
    Default File[YXD]
Return
####################################################################This is used while reading a record or reading each record and loading of the data
$LIENS
    Gosub LIENS From TABLEAUX
Return
######################################################################Creating and saving the data#####
$CREATION
    Gosub CREATION From TABLEAUX
Return
####################################################################################### Modifying the data after creation#########
$MODIF
    Gosub MODIF From TABLEAUX
Return
#################################################################################Deleting the single record or multiple records#####
$ANNULE
    Gosub ANNULE From TABLEAUX
Return
##################################################################### It is written for the sequence number generation in the header field####
$VERIF_CRE
Local Char ZNUMBER
Local Integer STAT
     Call NUMERO(“YIX”,””,date$,””,ZNUMBER,STAT) From SUBANM
[M:YVX0]YXNUM=ZNUMBER
Affzo[M:YVX0]
Return
###########################################################################

功能:
附件: 您需要登录才可以下载或查看附件。没有帐号?申请用户

返回列表