Component Interface EditHistoryItems Gotcha

本文详细解释了当您在与Component Interface API进行交互时,如何使用EditHistoryItems属性来控制组件的编辑历史行为。特别是对于包含EFFDT字段的记录,此属性在正确历史模式下允许您修改过去的数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

When you are writing code against a Component Interface API, there is an important boolean property on the CI called EditHistoryItems. Because a Component Interface will mimic the online logic as if a user were actually keying the data into the page there is a direct relationship between the Component Interface EditHistoryItems property and the “correct history mode” in the online component accessed via a web browser.

When you set “EditHistoryItems = True”, that is the same as entering a component in “Correct History.” This only really matters for components that have and EFFDT field as part of one of the records keys. If EFFDT is not part of the key structure then, correction history/editHistoryItems serves no purpose.

If you have EFFDT in they key structure and you enter a component in “Correct History” mode, it will allow you to change data that is dated in the past. Hence, the “correct history” nomenclature. If you try to correct past data and you are not in correct history mode, you will see an error in your web browser and the data will not be saved.

This is not the behaviour when working with Component Interface. If your programmatic code tries to correct some history in the CI and you set EditHistoryItems = False, it will fail silently trying to update the field property. So let’s say your code tries to make a change to some historical value on a field/CI property called DESCR and EditHistoryItems = False. The CI will just not take the value. I have seen that it just “silently” fails with no indication that you tried to correct history but where not in the correct mode.

I have seen this behaviour on 8.50. So make sure you do some testing in your code to determine if your code should be in correct history/editHistoryMode. It really depends on what your code is trying to do. Generally, it is frowned upon to update history but there are exceptions to this.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值