金蝶 k3 BOS开发百问百答(4)

2019-08-30 15:17

Exit Function err_ctr:

Set oDataSrv = Nothing Set objLookup = Nothing End Function

【摘要】:将当前单据转化为另一单据,并无界面保存数据 【版本】:K/3BOS 所有版本

问题描述: 将当前单据转化为另一单据,并无界面保存数据。 解决方法: '******************************************** '功能:将当前单据转化为另一单据,并无界面保存数据 '参数:lClassTypeID—显示BOS单据的ID

'******************************************** Private Sub NoUISaveBill(ByVal lClassTypeID As Long) Dim oDataSrv As Object Dim oTableInfo As Object Dim oBill As Object Dim oData As Object

Dim oSrv As Object 客户化开发技术资料——K/3 BOS开发百问百答

Dim oPage2 As Object Dim i As Long

On Error GoTo err_ctr Set oDataSrv =

m_BillInterface.K3Lib.CreateK3Object(\ oDataSrv.ClassTypeID = lClassTypeID Set oTableInfo = oDataSrv.TableInfo Set oData = oDataSrv.GetEmptyBill

For i = 1 To m_BillInterface.Data(\ Set oPage2 = oData(\

oData(\ '添加到 dcData

oData(\更改分录号 Next

For i = 1 To m_BillInterface.Data(\

oData(\ m_BillInterface.GetFieldValue(\ oData(\ m_BillInterface.GetFieldValue(\ oData(\ m_BillInterface.GetFieldValue(\ Next

Set oSrv = CreateObject(\ i = oSrv.Save(MMTS.PropsString, oDataSrv.ClassType,

oDataSrv.ClassTypeEntry, oDataSrv.TableInfo, oData, oDataSrv.dctLink) Set oDataSrv = Nothing Set oBill = Nothing Exit Sub err_ctr:

MsgBox Err.Description Set oDataSrv = Nothing Set oBill = Nothing End Sub 【备注】

1、K/3 BOS保存方法Save的参数描述: 'Public Function Save(ByVal sDsn As String, _

' ByVal dctClassType As KFO.Dictionary, _ ' ByVal vctClassTypeEntry As KFO.Vector, _ ' ByVal dctTableinfo As KFO.Dictionary, _ ' ByRef dctData As KFO.Dictionary, _

' ByVal dctLinks As KFO.Dictionary) As Long

'/********************************************************************/ '/*描述:单据保存 '/*参数:

'/*@ dctClassType KFO.Dictionary 单据整体信息模板 客户化开发技术资料——K/3BOS开发百问百答

'/*@ dctData KFO.Dictionary 单据数据包

'/*@ dctLink KFO.Dictionary 选单关系模板,无选单为Nothing '/*@ dctTableInfo KFO.Dictionary 单据字段模板信息 '/*@ sDsn String K/3标准数据库连接串

'/*@ vctClassTypeEntry KFO.Vector 单据体模板信息 '/*备注:

'/********************************************************************/ 2、使用此方法时插件要添加MMTS。

【摘要】:隐藏选单时序时簿不需的菜单和工具栏 【版本】:K/3BOS 所有版本

问题描述: 隐藏选单时序时簿不需的菜单和工具栏

解决方法: 在MenuBarInitialize事件中使用m_ListInterface.List.ShowMode判断(查看和选单)

1—查看;2—选单。

语法:If m_ListInterface.List.ShowMode = 1 Then ??end. 例:在选单时隐藏“编辑”菜单和工具栏 If m_ListInterface.List.ShowMode = 2 Then Dim oTool As K/3ClassEvents.BOSTool

Dim oBand As K/3ClassEvents.BOSBand

'*************** 开始设置 BOS 原有菜单 *************** '获得 mnuEdit 菜单对象,并设置属性 Set oBand = oMenuBar.BOSBands(\ Set oTool = oBand.BOSTools(\ With oTool

.Visible = False .Enabled = False End With End if

【摘要】:在单据体中让下一条分录自动携带上一条分录的数据 【版本】:K/3BOS 所有版本

问题描述: 如何在单据体中让下一条分录自动携带上一条分录的数据(只是部分字段)客户化开发技术资料——K/3 BOS开发百问百答

解决方法: 示例代码:

'物料录入后,第二行的值自动默认第一行的值 If dct(\ m_BillInterface.SetFieldValue \

m_BillInterface.GetFieldValue(\ row '提货地点 end if

大力水手 2009-08-01 21:37:32.0

【摘要】:在 Bos 插件中如何处理隐身的二次登录 【版本】:K3v10.2SP1

问题描述: 在自定义的 BOS 单据上,通过插件作生成凭证的功能,但是在调用凭证的 组件时,需要一个二次登录后才能使用相应的模块。如何处理隐身的二次 登录,或者其他的变通处理。

解决方法: 1、凭证组件的调用是不需要二次登录的,可能你是在VB 调试状态下运行,编译后就没 事了。

2、请参考下面代码

Private Sub m_BillInterface_MenuBarClick(ByVal BOSTool As K3ClassEvents.BOSTool, Cancel As Boolean)

Dim glvch As Object '中间层凭证对象 Dim mvch As KFO.Dictionary '待保存凭证头 Dim mvchentry As KFO.Vector '待保存凭证分录集 Dim entry As KFO.Dictionary '待保存凭证分录 Dim mvchdetail As KFO.Vector '核算项目明细集 Dim detail As KFO.Dictionary '核算项目明细 Dim i, iCount As Long

Dim vValue As Variant

'TODO: 请在此处添加代码响应事件 MenuBarClick Select Case BOSTool.ToolName Case \生成凭证\

vValue = m_BillInterface.GetFieldValue(\

If Not (CStr(vValue) = \

MsgBox \当前合同已经生成凭证!\金蝶提示\ Exit Sub End If

'此处添加处理 生成凭证 菜单对象的 Click 事件 Set mvch = New KFO.Dictionary

mvch(\客户化开发技术资料——K/3 BOS开发百问百答

mvch(\金华泰项目\

mvch(\ Set mvchentry = New KFO.Vector

vValue = m_BillInterface.GetFieldValue(\ '合同 金额

'创建凭证分录

Set entry = New KFO.Dictionary

entry(\ entry(\ entry(\

entry(\ '数量&单价

entry(\ entry(\

entry(\ '创建核算项目明细

Set mvchdetail = New KFO.Vector Set detail = New KFO.Dictionary detail(\ detail(\ mvchdetail.Add detail

Set entry(\ mvchentry.Add entry

Set mvch(\ Set entry = New KFO.Dictionary

entry(\ entry(\ entry(\

entry(\ '数量&单价

entry(\ entry(\

entry(\ '创建核算项目明细

Set mvchdetail = New KFO.Vector Set detail = New KFO.Dictionary detail(\ detail(\ mvchdetail.Add detail

Set entry(\客户化开发技术资料——K/3 BOS开发百问百答

mvchentry.Add entry

Set mvch(\

Dim s As String

s = \Source=JAMES;

Initial Catalog=xt_3};UserName=administrator;UserID=16394;DBMS Name=Microsoft SQL Server;DBMS

Version=2000;SubID=GL;AcctType=gy;Setuptype=Industry;Language=chs;

IP=192.168.1.92;MachineName=JAMES;UUID=800A878D-F574-4877-B79C-D88AB721ECA0\

Set glvch = CreateObject(\oucher.VoucherUpdate\

glvch.Create s, mvchs = \ fUser1=\

& m_BillInterface.K3Lib.User.UserID & \ m_BillInterface.GetFieldValue(\

m_BillInterface.K3Lib.UpdateData s m_BillInterface.RefreshBill

MsgBox \凭证生成成功!\金蝶提示\

Case \变更\ End Select End Sub


金蝶 k3 BOS开发百问百答(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:小学英语三年级下阅读周周练(第七周)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: