范例(axmt500):
目的,控制新增的栏位(价格清单2),需点击菜单栏“修改价格清单2”才能对相应的栏位进行编辑修改,并记录修改人、日期;
1)在规格上增加新ACTION——action_modify_xmdaua012,修改价格清单2;并在azzi903上把ACTION添加到菜单栏;
2)在单头栏位开启设定中【 axmt500_set_entry(p_cmd)】对“价格清单2”栏位进行关闭,不允许编辑:
CALL cl_set_comp_entry("xmdaua012",FALSE) # by ljr
3)在单头栏位关闭设定中【 axmt500_set_no_entry(p_cmd)】对“价格清单2”栏位进行关闭, 不允许编辑:
CALL cl_set_comp_entry("xmdaua012",FALSE) # by ljr
4)在ui_dialog中,ON ACTION action_modify_xmdaua012 下编辑程序:
#應用 a43 樣板自動產生(Version:)
ON ACTION action_modify_xmdaua012
LET g_action_choice="action_modify_xmdaua012"
IF cl_auth_chk_act("action_modify_xmdaua012") THEN #add-point:ON ACTION action_modify_xmdaua012 name="menu.action_modify_xmdaua012"
# by ljr s DIALOG ATTRIBUTES(UNBUFFERED,FIELD ORDER FORM)
INPUT g_xmda_m.xmdaua012 FROM xmdaua012 ATTRIBUTES(WITHOUT DEFAULTS) ON ACTION controlp INFIELD xmdaua012
INITIALIZE g_qryparam.* TO NULL
LET g_qryparam.state = 'i'
LET g_qryparam.reqry = FALSE
CALL cq_xmdtdoocno() #呼叫開窗
#DISPLAY g_qryparam.return1 TO xmdaua012 #顯示到畫面上
LET g_xmda_m.xmdaua012 = g_qryparam.return1
DISPLAY BY NAME g_xmda_m.xmdaua012 SELECT xmdtua001 INTO g_xmda_m.xmdaua012_desc FROM xmdt_t
WHERE xmdtdocno=g_xmda_m.xmdaua012
DISPLAY BY NAME g_xmda_m.xmdaua012_desc NEXT FIELD xmdaua012 #返回原欄位 END INPUT BEFORE DIALOG
CALL cl_set_comp_entry("xmdaua012",TRUE)
#重新導回資料到正確位置上
CALL DIALOG.setCurrentRow("s_detail1",g_idx_group.getValue("'1','2',"))
CALL DIALOG.setCurrentRow("s_detail2",g_idx_group.getValue("'3',"))
CALL DIALOG.setCurrentRow("s_detail3",g_idx_group.getValue("'4',"))
CALL DIALOG.setCurrentRow("s_detail4",g_idx_group.getValue("'5',"))
CALL DIALOG.setCurrentRow("s_detail5",g_idx_group.getValue("'6',"))
CALL DIALOG.setCurrentRow("s_detail6",g_idx_group.getValue("")) ON ACTION controlf
CALL cl_set_focus_form(ui.Interface.getRootNode()) RETURNING g_fld_name,g_frm_name
CALL cl_fldhelp(g_frm_name,g_fld_name,g_lang) ON ACTION controlr
CALL cl_show_req_fields() ON ACTION controls
IF g_header_hidden THEN
CALL gfrm_curr.setElementHidden("vb_master",)
CALL gfrm_curr.setElementImage("controls","small/arr-u.png")
LET g_header_hidden = #visible
ELSE
CALL gfrm_curr.setElementHidden("vb_master",)
CALL gfrm_curr.setElementImage("controls","small/arr-d.png")
LET g_header_hidden = #hidden
END IF ON ACTION accept
IF NOT cl_null(g_xmda_m.xmdaua012) THEN
INITIALIZE g_chkparam.* TO NULL
LET g_chkparam.arg1 = g_xmda_m.xmdaua012
IF cl_chk_exist("cv_xmdtdocno") THEN
LET g_xmda_m.xmdaua013 = g_user
LET g_xmda_m.xmdaua014 = cl_get_current()
UPDATE xmda_t SET xmdaua012=g_xmda_m.xmdaua012,
xmdaua013=g_xmda_m.xmdaua013,
xmdaua014=g_xmda_m.xmdaua014
WHERE xmdaent=g_enterprise AND xmdasite=g_site AND xmdadocno=g_xmda_m.xmdadocno
DISPLAY BY NAME g_xmda_m.xmdaua013,g_xmda_m.xmdaua014
SELECT ooag011 INTO g_xmda_m.xmdaua013_desc FROM ooag_t WHERE ooag001=g_xmda_m.xmdaua013
DISPLAY BY NAME g_xmda_m.xmdaua013_desc
END IF
END IF ACCEPT DIALOG ON ACTION cancel #在dialog button (放棄)
#add-point:input段cancel name="input.cancel" #end add-point
LET INT_FLAG = TRUE
LET g_detail_idx =
LET g_detail_idx2 =
#各個page指標
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] = CALL g_curr_diag.setCurrentRow("s_detail1",)
CALL g_curr_diag.setCurrentRow("s_detail2",)
CALL g_curr_diag.setCurrentRow("s_detail3",)
CALL g_curr_diag.setCurrentRow("s_detail4",)
CALL g_curr_diag.setCurrentRow("s_detail5",)
CALL g_curr_diag.setCurrentRow("s_detail6",) EXIT DIALOG ON ACTION close #在dialog 右上角 (X)
#add-point:input段close name="input.close" #end add-point
LET INT_FLAG = TRUE
EXIT DIALOG ON ACTION exit #toolbar 離開
#add-point:input段exit name="input.exit" #end add-point
LET INT_FLAG = TRUE
LET g_detail_idx =
LET g_detail_idx2 =
#各個page指標
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] =
LET g_detail_idx_list[] = CALL g_curr_diag.setCurrentRow("s_detail1",)
CALL g_curr_diag.setCurrentRow("s_detail2",)
CALL g_curr_diag.setCurrentRow("s_detail3",)
CALL g_curr_diag.setCurrentRow("s_detail4",)
CALL g_curr_diag.setCurrentRow("s_detail5",)
CALL g_curr_diag.setCurrentRow("s_detail6",) EXIT DIALOG #交談指令共用ACTION
&include "common_action.4gl"
CONTINUE DIALOG
END DIALOG
# by ljr e
#END add-point END IF
这DIALOG段落内容可参考axmt500_input 下的axmt500.input.other 段落;