Landed Cost. Bookin Activated  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Landed Cost. Bookin Activated

Postby DannyC » Mon Aug 17, 2015 1:46 pm

I need to do something when a bookin has been activated.

So far I have the code
Code: Select all
    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
      Dim BookInForm As JiwaLandedCostUI.BookIn.BookIn = DirectCast(JiwaForm, JiwaApplication.IJiwaForm)
      AddHandler BookInForm.Activated, AddressOf BookIn_Activated      
    End Sub
   
   Sub BookIn_Activated (sender As Object, e As System.eventargs)
      Dim BookIn As JiwaLandedCost.BookIn.BookIn = DirectCast( sender , JiwaLandedCost.BookIn.BookIn)
      msgbox(BookIn.BookInNo)
      
   End Sub


But as soon as I load the bookin form, I get an error "Unable to cast object of type JiwaFinancials.Jiwa.JiwaLandedCostUI.BookIn.BookIn to type JiwaFinancials.Jiwa.JiwaLandedCost.BookIn.BookIn.

I know the error lies in the Dim within the Sub but I cannot find the correct syntax to use.

Regards

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Landed Cost. Bookin Activated  Topic is solved

Postby Scott.Pearce » Tue Aug 18, 2015 3:21 pm

Code: Select all
AddHandler BookInForm.Activated, AddressOf BookIn_Activated



You are hooking into the wrong event. That is the Activated event for the *windows form*. You should be hooking into either the SaveStart, SaveEnding, or SaveEnd event for the business logic (depending on what exactly you will be doing), and examining the objects' .Activated property.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Landed Cost. Bookin Activated

Postby DannyC » Wed Aug 19, 2015 10:32 am

Ahh I see.
Sussed it out & all good now.

Thanks
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests