【问题标题】:How to update tables in fields after amending existing information修改现有信息后如何更新字段中的表格
【发布时间】:2022-11-02 16:55:15
【问题描述】:
我目前需要添加到每次用户单击更新其任何信息的程序上的“保存”按钮时更新的表。
当任何字段被修改时,为了我们有更改日志,我需要在“slinfo”表上创建一条记录,包括:
Customer name (slinfo.name)
Customer account (slinfo.acode)
The date (slinfo.date)
And slinfo.seq, which is the sequence number for each change.
我将如何去做这样的事情?
【问题讨论】:
标签:
openedge
progress-4gl
【解决方案1】:
/* presumably you already have a save trigger to save the amended values
* this code should go in that trigger, probably at the end
*/
/* I, obviously, have no way to know where the actual values for
* these variables are supposed to come from. if the logic for
* that is simple enough you might even be able to eliminate the variables
*/
define variable nameVariable as character no-undo.
define variable acodeVariable as character no-undo. /* I'm guessing that this is a character field */
define variable seqVariable as integer no-undo.
/* do something to populate the variables...
*/
/* since you are apparently already saving changes to slinfo
* you just need to add a few fields
*/
assign
slinfo.name = nameVariable
slinfo.acode = acodeVariable
slinfo.date = today
slinfo.seq = seqVariable
.