以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 调用的目标发生了异常 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=145129) |
-- 作者:季朝龙 -- 发布时间:2020/1/9 11:40:00 -- 调用的目标发生了异常 Dim qt As Integer If e.DataCol.Name = "工单号" Then qt = DataTables("齐套信息").sqlCompute("Count(工单号)","[工单号] = \'" & e.NewValue & "\' and [缺料] <> 0") If qt = 0 Then e.DataRow("物料齐套情况") = "齐套" Else e.DataRow("物料齐套情况") = "未齐套," & "缺少" & qt & "款物料" End If End If If e.DataCol.Name <> "更新记录" Then Dim lsjl As String = e.DataRow.OriginalValue("更新记录") If e.DataRow("更新记录") = "" Then e.DataRow("更新记录") = Date.Now() & " " & e.DataCol.Name & ":" & e.OldValue & " 变更为 " & e.NewValue & "; 操作人: " & user.Name Else e.DataRow("更新记录") = Date.Now() & " " & e.DataCol.Name & ":" & e.OldValue & " 变更为 " & e.NewValue & "; 操作人: " & user.Name & Chr(13) & Chr(10) & lsjl End If DataTables("试产项目进度表").Save() End If If e.DataRow("工单号") <> "" Then e.DataRow("主键列") = e.DataRow("工单号") End If |
-- 作者:有点蓝 -- 发布时间:2020/1/9 12:00:00 -- Dim qt As Integer If e.DataCol.Name = "工单号" Then qt = DataTables("齐套信息").sqlCompute("Count(工单号)","[工单号] = \'" & e.NewValue & "\' and [缺料] <> 0") If qt = 0 Then e.DataRow("物料齐套情况") = "齐套" Else e.DataRow("物料齐套情况") = "未齐套," & "缺少" & qt & "款物料" End If If e.DataRow("工单号") <> "" Then e.DataRow("主键列") = e.DataRow("工单号") End If End If If e.DataCol.Name <> "更新记录" Then Dim lsjl As String = e.DataRow.OriginalValue("更新记录") If e.DataRow("更新记录") = "" Then e.DataRow("更新记录") = Date.Now() & " " & e.DataCol.Name & ":" & e.OldValue & " 变更为 " & e.NewValue & "; 操作人: " & user.Name Else e.DataRow("更新记录") = Date.Now() & " " & e.DataCol.Name & ":" & e.OldValue & " 变更为 " & e.NewValue & "; 操作人: " & user.Name & Chr(13) & Chr(10) & lsjl End If DataTables("试产项目进度表").Save() End If
|
-- 作者:季朝龙 -- 发布时间:2020/1/9 12:47:00 -- 代码修改了,直接输入数据不会出错了 但是,合并数据(将excel数据合并进来)的时候还是会出现错误,错误提示如下: .NET Framework 版本:4.0.30319.42000 Foxtable 版本:2019.12.8.1 错误所在事件:表,试产项目进度表,DataColChanged 详细错误信息: 调用的目标发生了异常。 没有要访问的 Original 数据。 |
-- 作者:有点蓝 -- 发布时间:2020/1/9 13:45:00 -- Dim lsjl As String = IIF(e.DataRow.OriginalValue is nothing,"",e.DataRow.OriginalValue("更新记录")) |
-- 作者:季朝龙 -- 发布时间:2020/1/9 14:03:00 -- 把这段代码改了,还是出现同样的错误提示 Dim lsjl As String = IIF(e.DataRow.OriginalValue("更新记录") Is Nothing,"",e.DataRow.OriginalValue("更新记录"))
|
-- 作者:有点蓝 -- 发布时间:2020/1/9 14:17:00 -- Dim lsjl As String = "" if e.DataRow.OriginalValue Isnot Nothing thenlsjl = e.DataRow.OriginalValue("更新记录") end if
|