首先看这个帖子,了解插件如何开发 https://vip.kingdee.com/link/s/ltfaZ,这个帖子里已经有源码了,再这个源码基础上添加文中代码编译后放到k3erp目录即可查看效果;
效果图
首先找到自定义字段再表头的位置
添加代码,加载单据事件
Private Sub m_BillTransfer_LoadBillEnd(ByVal ShowType As Long)
If m_BillTransfer.SaveVect Is Nothing Then
If lngUserDatePlace > 0 Then
m_BillTransfer.SetHead lngUserDatePlace, ""
End If
End If
End Sub
Private Sub m_BillTransfer_NewBillEnd()
If lngUserDatePlace > 0 Then
m_BillTransfer.SetHead lngUserDatePlace, ""
End If
End Sub
Private Function GetHeadCtlOrderByFieldName(ByVal strFieldName As String) As Long
Dim i As Long
For i = 1 To UBound(m_BillTransfer.HeadCtl)
If UCase(Trim(m_BillTransfer.HeadCtl(i).FieldName)) = UCase(Trim(strFieldName)) Then
GetHeadCtlOrderByFieldName = i
Exit Function
End If
Next i
GetHeadCtlOrderByFieldName = 0
End Function
推荐阅读