none
infopath表单库无法使用AfterProperties RRS feed

  • 问题

  •  

    我为一个infopath表单库(infopath Forms Services)重载SPItemEventReceive接收类的ItemAdding事件

    Public Class Lzyoa_ypjy_ValidateEventHandler
        Inherits SPItemEventReceiver
        '正添加样品检验单
        Public Overrides Sub ItemAdding(ByVal properties As Microsoft.SharePoint.SPItemEventProperties)
            MyBase.ItemAdding(properties)
            Try

                '取到用户输入的信息,用AfterProperties
                Dim AfterData As SPItemEventDataCollection = properties.AfterProperties
                Dim myList As SPList = properties.OpenWeb().Lists(properties.ListId)

                Dim NameField As String = myList.Fields.GetField("标题").InternalName

                Dim YpbhField As String = myList.Fields.GetField("样品编号").InternalName
                Dim CplxField As String = myList.Fields.GetField("产品类型").InternalName
                Dim LdjcField As String = myList.Fields.GetField("粒度检测").InternalName
                Dim DhxfxField As String = myList.Fields.GetField("电化学分析").InternalName

                '判断必填字段是否为空

                If Trim(CType(AfterData(YpbhField), String)) = "" Then
                    properties.Cancel = True
                    properties.ErrorMessage = "样品编号不能为空!"
                    Exit Sub
                End If
                If Trim(CType(AfterData(CplxField), String)) = "" Then
                    properties.Cancel = True
                    properties.ErrorMessage = "请选择产品类型!"
                    Exit Sub
                End If
                If Trim(CType(AfterData(LdjcField), String)) = "" Then
                    properties.Cancel = True
                    properties.ErrorMessage = "请选择分配粒度检测任务!"
                    Exit Sub
                End If
                If Trim(CType(AfterData(DhxfxField), String)) = "" Then
                    properties.Cancel = True
                    properties.ErrorMessage = "请选择分配电化学分析任务!"
                    Exit Sub
                End If

    End sub

    End class

     

    发现用properties.AfterProperties取不出客户要保存的表单信息,怎么解决这个问题?

    2008年4月29日 7:07