K3老單序時簿開發示例


K3需要對老單進行二次開發,老單的二次開發比較麻煩,這里整理一下老單序時簿上添加按鈕的二次開發示例。

 

--以下SQL腳本
--獲取 MENU ID
select FID,FmenuID,FName from iclisttemplate where Fname LIKE '%生產領料%' --(FID=11,FmenuID=82)
--增加元數據按鈕
select * from t_MenuToolBar order by FToolID
Delete From t_MenuToolBar Where FToolID = '10005'
insert into t_MenuToolBar (FToolID,FName,FCaption,FCaption_CHT,FCaption_EN,FImageName,FToolTip,FToolTip_CHT,FToolTip_EN,FControlType,FVisible,FEnable,FChecked,FShortCut,FCBList,FCBList_CHT,FCBList_EN,FCBStyle,FCBWidth,FIndex,FToolCaption,FToolCaption_CHT,FToolCaption_EN)
values (10005,'HMPrint','匯總打印','匯總打印','Print(HM)','6','匯總打印','匯總打印','Print(HM)',0,0,1,0,0,'','','',0,0,0,'匯總打印','匯總打印','Print(HM)')

--將上面的按鈕插入到工具欄
select * from t_BandToolMapping where fid=82 and fbandid=53 order by findex
Delete From t_BandToolMapping where FToolID = 10005 and FID = 82
insert into t_BandToolMapping (FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup)
values (82,53,10005,0,77,'|zh_ActiveX_XYL.List_iTool',1) --插件名稱.類模塊名稱

--在[生產領料單]序時薄顯示按鈕(如果里面有"|V",則只能在后面加菜單項)
select * from IclistTemplate where FID =11
Update IclistTemplate
set FLogicStr=FLogicStr+ Case When Right(FLogicStr,1)='|' then 'V:HMPrint' else '|V:HMPrint' end
where FID =11 and FLogicStr not like '%HMPrint%'

--以下插件代碼:
Public Sub MainFunction(ByVal sKey As String, oList As Object, ByRef bCancel As Boolean)
    Dim i As Long
    Dim FInterID As Long
    Dim FEntryID As Long

    If sKey = "HMPrint" Then
    oList.MultiSelect = 2
        For i = 1 To oList.ListSelectBillinfo.Size
        FInterID = oList.ListSelectBillinfo(i)("FInterID")
        FEntryID = oList.ListSelectBillinfo(i)("FEntryID")
    Next
    End If
end sub


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM