电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

BOS插件中设置单据体下拉列表字段的下拉列表值

来源:金蝶云社区作者:金蝶2024-09-224

BOS插件中设置单据体下拉列表字段的下拉列表值

BOS插件中设置单据体下拉列表字段的下拉列表值

Private Sub m_BillInterface_AfterLoadBill()

    Dim dct As KFO.Dictionary

    Dim dctPage As KFO.Dictionary

    Dim oGrid As Object

    

    Set dctPage = New KFO.Dictionary

    '要得到的单据体的Page

    dctPage("FPage") = 2

    '通过插件对象m_BillInterface获取到单据体控件对象

    Set oGrid = m_BillInterface.BillCtl.GetObject("CTRL_GRID", dctPage)

    '根据字段关键字(FComboxList)获取到要设置的下拉列表字段的模板,主要获取字段所在列:CtlIndex

    Set dct = m_BillInterface.GetFieldInfoByKey("FComboxList", "", 0)

    With oGrid

        .ReDraw = False

        .BlockMode = True

        .Col = dct("CtlIndex") '定位字段所在列

        .Col2 = dct("ctlIndex")

        .Row = 1

        .Row2 = .MaxRows '选择所有行

        .TypeComboBoxList = GetGridComboxList() '设置下拉列表值

        .BlockMode = False

    End With

    

    Set dct = Nothing

    Set dctPage = Nothing

    Set oGrid = Nothing

End Function



'拼接下拉列表值字符串

Public Function GetGridComboxList() As String

    Dim i As Long

    Dim dctList As KFO.Dictionary

    Dim strList As String

    Dim rs As ADODB.Recordset

    

    strList = ""

    

    '第一种情况:没有可循环的数据包结构,自己构造循环数据包dctList

    'dctList("保存值")="显示值"

    Set dctList = New KFO.Dictionary

    dctList("1") = "广州市"

    dctList("2") = "深圳市"

    dctList("3") = "珠海市"

    '依此类推。。。

    For i = 1 To dctList.Count

   

BOS插件中设置单据体下拉列表字段的下拉列表值

BOS插件中设置单据体下拉列表字段的下拉列表值Private Sub m_BillInterface_AfterLoadBill() Dim dct As KFO.Dictionary Di...
点击下载文档文档为doc格式

声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

已经是第一篇
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信