工业单据二次开发文档 下载本文

工业单据二次开发要点 1、 新建Active DLL工程 2、 工程中引用 K3BillTransfer K3ClassEvents

Kingdee Foundation Objects 1.0

Microsoft Active Data Object 2.8 Library 3、 类中引用

Private WithEvents m_BillTransfer As k3BillTransfer.Bill 加载单据事件:

Public Sub Show(ByVal o As Object) Set m_BillTransfer = o End Sub

Private Sub m_BillTransfer_BillInitialize()

m_BillTransfer.AddUserMenuItem \批号生成\用户菜单\End Sub

Private Sub m_BillTransfer_UserMenuClick(ByVal Index As Long, ByVal Caption As String)

'/用户在这实现菜单的响应 Select Case Index Case 1

createbatchno End Select End Sub

取得单据体中内容:

sl1 = m_BillTransfer.GetGridText(Row, 15) --得到字符串

m_BillTransfer.EntryCtl(2).DInterID(Row) –得到单据体相应行列中的内码.

赋单据体中内容

m_BillTransfer.SetGridText Row, 17, CStr(djtemp)

得到表体中的内容

sj = m_BillTransfer.GetHeadText(0) –字符串

dep = m_BillTransfer.HeadCtl(1).vale –得到表体中的内码

插件中ADO连接字符串: m_BillTransfer.Cnnstring

插入单据体中

For i = 1 To rs.RecordCount

m_BillTransfer.SetGridText i, 3, CStr(rs.Fields.Item(0).Value) '物料代码 m_BillTransfer.SetGridText i, 8, CStr(rs.Fields.Item(1).Value) '批号 m_BillTransfer.SetGridText i, 17, rs.Fields.Item(2).Value '实发数量

'm_BillTransfer.SetGridText i, 28, CStr(rs.Fields.Item(0).value) '发料仓库 m_BillTransfer.SetGridText i, 29, CStr(rs.Fields.Item(3).Value) '仓位 m_BillTransfer.BillForm.insertrow rs.MoveNext Next

帐套数据表中处理

--工业单据,组件在表中增加

select * from t_ThirdPartyComponent where FTypeDetailID = 21

--工业单据的ID号

select * from ICTransactionType where FName = '销售出库'

--增加销售出库单据工业单据。

insert into t_ThirdPartyComponent (FTypeID,FTypeDetailID,FIndex,FComponentName) values (0,21,1,'JLBill.OutBillAdd')