BOS单据的单据体字段支持F7选择用户的插件示例代码
https://vip.kingdee.com/article/46700727729979392
Private Sub m_BillInterface_MenuBarClick(ByVal BOSTool As K3ClassEvents.BOSTool, Cancel As Boolean)
Dim Base As Object
Dim rs As ADODB.Recordset
Dim ctl As Object
Dim lRow As Long
Dim lCol As Long
If BOSTool.ToolName = "mnuDataLookUp" Then '捕获到F7
Set ctl = m_BillInterface.GetActiveCtl
If Not ctl Is Nothing Then
If UCase(ctl.Name) = "GRID" Then '表格控件
lRow = ctl.ActiveRow
lCol = ctl.ActiveCol
Set dct = m_BillInterface.GetFieldInfoByKey("FUserID", "", 0)
If lCol = dct("CtlIndex") Then '对应用户字段列
Set Base = CreateObject("K3BaseList.BaseList")
Set rs = Base.Show(m_BillInterface.K3Lib.User.UserID, -5)
If Not rs Is Nothing Then
If Not rs.EOF Then
LookupClassUser = rs("FName")
'LookupClassUser = rs("FUserID")
End If
End If
End If
End If
End If
Set rs = Nothing
Set Base = Nothing
End If
End Function
