[PU9功能解说] 在Sage X3中如何用Tableaux编写代码?
[b]TABLEAUX – Sage X3[/b]在Sage X3中,TABLEAUX是另一种在编写最少代码行的情况下执行数据的方式。但TABLEAUX只能用于对象管理型的窗体。
[b]下面我们演示了TABLEAUX创建、修改和删除。[/b]
[b]步骤:[/b]
[b]第1步:[/b]创建两个不同的表,一个是表头表,另一个是明细表。
[b]第2步:[/b]创建两个屏幕,一个是表头屏幕,另一个是明细屏幕。
[b]第3步:[/b]为对象和编码部分创建一个新的窗体。
[b]第4步:[/b]在功能中修改和删除记录。
[b]创建表:[/b]下面是我们创建的两个表。
[b]表头表:[/b]
[attach]4580[/attach]
[b]表索引:[/b]
[attach]4581[/attach]
[b]明细表:[/b]
[attach]4582[/attach]
[b]表索引:[/b]
[attach]4583[/attach]
在创建了表头,表屏幕和窗体之后,还必须创建以下组件。
[b]对象:[/b]
[attach]4584[/attach]
[b]如下图所示:[/b]
[attach]4585[/attach]
编码部分:
##################################################################$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
###########################################################################
[b]功能:[/b]
[attach]4586[/attach]
页:
[1]