Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:07:10+00:00 2026-05-29T09:07:10+00:00

Can someone check my .NET code that I have in an InfoPath button to

  • 0

Can someone check my .NET code that I have in an InfoPath button to see what the heck I am doing wrong? I am trying to publish my InfoPath form to SharePoint 2007.

The custom code for the button (clicked) is not being executed. TDAPIOLEib is COM component for Quality Center that is added as a reference. I have also tried putting the code in the form submission and that does not work either.

Many thanks in advance and I will give you as many rep points as I can.

Imports Microsoft.Office.InfoPath
Imports System
Imports System.Xml
Imports System.Xml.XPath
Imports TDAPIOLELib
Imports System.Security.AllowPartiallyTrustedCallersAttribute



Namespace InfoPath_QC_Submit_4
    Public Class FormCode
        ' Member variables are not supported in browser-enabled forms.
        ' Instead, write and read these values from the FormState
        ' dictionary using code such as the following:
        '
        ' Private Property _memberVariable() As Object
        '     Get
        '         _memberVariable = FormState("_memberVariable")
        '     End Get
        '     Set
        '         FormState("_memberVariable") = value
        '     End Set
        ' End Property

        ' NOTE: The following procedure is required by Microsoft Office InfoPath.
        ' It can be modified using Microsoft Office InfoPath.
        Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup
            AddHandler DirectCast(EventManager.ControlEvents("btnSubmit"), ButtonEvent).Clicked, AddressOf btnSubmit_Clicked
        End Sub

        Public Sub btnSubmit_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
            Try
                Dim qcconn As New TDAPIOLELib.TDConnection
                Dim qcserver As String

                qcserver = "http://qualitycenterurl/qcbin/"

                qcconn.InitConnectionEx(qcserver)
                qcconn.Login("username", "password")
                qcconn.Connect("Domain", "Project")

                Dim BugF As TDAPIOLELib.BugFactory
                Dim bug1 As TDAPIOLELib.Bug


                BugF = qcconn.BugFactory
                bug1 = BugF.AddItem(DBNull.Value)

                Dim xnDoc As XPathNavigator = Me.MainDataSource.CreateNavigator()


                bug1.Field("BG_Summary") = xnDoc.Select("/my:myFields/Issue_Summary")
                bug1.Field("bg_Description") = xnDoc.Select("/my:myFields/Issue_Description")
                bug1.Field("bg_Priority") = xnDoc.Select("/my:myFields/Priority")
                bug1.Field("bg_detection_date") = xnDoc.Select("/my:myFields/Reported_Date")
                bug1.Field("bg_user_57") = xnDoc.Select("/my:myFields/Requestor")

                bug1.Field("bg_user_64") = "Incident"
                bug1.Field("bg_severity") = "Low"
                bug1.Field("bg_user_55") = "N"
                bug1.Field("bg_detected_by") = "SharePoint"
                bug1.Field("bg_user_31") = "Other"

                bug1.Post()

                If qcconn.Connected Then
                    qcconn.Disconnect()
                End If

                If qcconn.LoggedIn Then
                    qcconn.Logout()
                End If

            Catch ex As Exception
            End Try
        End Sub
    End Class
End Namespace
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:07:11+00:00Added an answer on May 29, 2026 at 9:07 am

    1. Set the form’s Security Level to ‘Full’

    (InfoPath 2007): Tools –> Form Options –> Security and Trust (category) –> Uncheck ‘Automatically determine security level’ –> Manually check ‘Full Trust’ –> click ‘Ok’ when you are done.

    2. Create and assign a form template signature

    (InfoPath 2007): Tools –> Form Options –> Security and Trust (category) –> Check ‘Sign this form template’ –> Click ‘Select Certificate’ –> click ‘Ok’ when you are done.

    *Note for #2: You may have to google search ‘Add InfoPath Certificate’ or start by using this link: MSDN – Deploying Signed Infopath Form Templates

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone help me with some code to check for duplicates in an NSArray
Can someone point me to good resource for Net::HTTP? I'm trying to understand why
Can someone help me check my bash script? i'm trying to feed a directory
Can someone tell me why this unit test that checks for exceptions fails? Obviously
can someone explain me how to check LINQ generated SQL queries in VWD 2008?
Maybe someone can clear me up. I have been surfing on this a while
I have a datatable being built in code which can dynamically have any given
I am using asp.net mvc. I have generated a view that retrieve all unapproved
How do I see a disassembly of the machine code generated by the .net
This really, really urks me, so I hope that someone can give me a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.