Community
Showing results for 
Search instead for 
Do you mean 
Reply

ContactFieldDescriptors - strange behavior

Accepted Solution Solved
Copper Super Contributor
Posts: 88
Country: USA
Accepted Solution

ContactFieldDescriptors - strange behavior

[ Edited ]

Hi:

 

I have the following code in my Plugin:

 

    Sub Button1Click(sender As Object, e As EventArgs)
        Try
            Dim cFields As Act.Framework.Contacts.ContactFieldDescriptor() = Me.HostApplication.ActFramework.Contacts.GetContactFieldDescriptors()
            textBox1.Text = "It works!"
        Catch ex As Exception
            textBox1.Text = ex.Message
        End Try
    End Sub

 

This code works fine in a UserControl inside my Plugin, but I get an error message when I run it in a Form in my Plugin:

   "Object reference not set to an instance of an object."

 

Any idea why it will run in a UserControl and not in a Form?


Accepted Solutions
Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: ContactFieldDescriptors - strange behavior

Did you pass in the ActApplication object from your plugin into your form? My guess is that your HostApplication == null.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: ContactFieldDescriptors - strange behavior

Did you pass in the ActApplication object from your plugin into your form? My guess is that your HostApplication == null.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 88
Country: USA

Re: ContactFieldDescriptors - strange behavior

Matt:

 

A long time in replying, but I have the same issue popping up.

 

How do I transfer the ActApplication object to the form?

 

Thanks!

Copper Super Contributor
Posts: 88
Country: USA

Re: ContactFieldDescriptors - strange behavior

Through sheer dumb luck (and more than a few attempt) I have it figured out.

 

Thanks again for your help.