Community
Showing results for 
Search instead for 
Do you mean 
Reply

Logged in Status when opening form

Accepted Solution Solved
Nickel Elite Contributor
Posts: 508
Country: USA
Accepted Solution

Logged in Status when opening form

[ Edited ]

I have a plugin that opens a form to ask for input.  On the button click events in that new form, when I try to do anything with a contact, I get

 

System.NullReferenceException: Object reference not set to an instance of an object. at project.Prompt.btnCurrentContact_Click(Object sender, EventArgs e)

or

Act.Framework.NotLoggedOnException: An attempt was made to access the framework without having logged on to a database. Please log on to a database first. at Act.Framework.ActFramework.get_Contacts() at project.Prompt.btnMyRecord_Click(Object sender, EventArgs e)

 based on trying to get My Record, or the Current Contact.  How come the new form does not "stay logged in"?  thanks...

 

The Two lines of code to get the contacts are:

Dim curContact As Contact = ActApp.ApplicationState.CurrentContact

 and

Dim myContact As Contact = ActFwk.Contacts.GetMyRecord()

Message Edited by rbrust on 08-19-2009 10:20 AM
Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com

Accepted Solutions
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Logged in Status when opening form

Hi Richard,

 

Do you still get the error with this:

 

Dim curContact As COntact = ActApp.ApplicationState.CurrentContactDim myContact As Contact = ActApp.ActFramework.Contacts.GetMyRecord()

 I've forgotten a lot of VB syntax since I do everything in C# now so sorry for any syntax errors! I'm presuming that you are using a diiferent ActFramework object rather than the ActApp ActFramework object and that is why it is giving the error.

 

HTH

Vivek 

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Logged in Status when opening form

Hi Richard,

 

Do you still get the error with this:

 

Dim curContact As COntact = ActApp.ApplicationState.CurrentContactDim myContact As Contact = ActApp.ActFramework.Contacts.GetMyRecord()

 I've forgotten a lot of VB syntax since I do everything in C# now so sorry for any syntax errors! I'm presuming that you are using a diiferent ActFramework object rather than the ActApp ActFramework object and that is why it is giving the error.

 

HTH

Vivek 

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Super Contributor
Posts: 59
Country: USA

Re: Logged in Status when opening form

Hi Richard,

 

Seems to me that both ActApp and ActFw objects haven't been assigned when they reach that point of code. Can you set a breakpoint and check the values of those two objects?

 

If they return nothing, then it means you need to assign those two objects values before you click the button. Usually this is done when the plugin loads on the ACTAPP_AfterLogon plugin event. 

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Logged in Status when opening form

So, at Woodstock they had bad acid, I was using some bad code from the SDK samples.  I passed the ActApp (

Private ActApp As ActApplication) object to the form, and the Current Contact worked fine.  But, the My Record still did not work, and it turns out the line was incorrect, and the one you sent worked.

 

Thanks!

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Tuned Listener
Posts: 4
Country: United States

Re: Logged in Status when opening form

hello everybody,

 

I have a custom application being opened from the Act application. On opening of my custom desktop application I need to display the current contact name. How can I do that.?

 

I assume it could be done using plugin , but please explain me the exact steps to do that. I am using C#.

 

Please help.

 

Nickel Super Contributor
Posts: 441
Country: UK

Re: Logged in Status when opening form

Have a look in the SDK samples, there is one for marshalling data to another application.  Its definately in the 8 and 9 SDKs; I haven't checked the newer ones.

 

Tin