Service Job getting debtor informaiton on Job start  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Service Job getting debtor informaiton on Job start

Postby indikad » Tue May 20, 2014 4:21 pm

I need to get the debtor information on a new job start ( New Job | select debtor ).
However I cannot find a event with a parameter that gets the required information

part of code I am trying is below
Code: Select all

If TypeOf JiwaForm Is JiwaServiceManagerUI.Jobs Then         
            Dim JobForm As JiwaServiceManagerUI.Jobs = DirectCast(JiwaForm, JiwaApplication.IJiwaForm)   

         AddHandler JobForm.Job.CreateStart  , AddressOf JobCreateStart
         
         _attDebtor.Read(JobForm.Job.Debtor.DebtorID)
End If
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Service Job getting debtor informaiton on Job start

Postby Mike.Sheen » Tue May 20, 2014 4:38 pm

Hi Indika,

I believe you want to add a handler for the debtor entity read event of the job - see below

Code: Select all
Public Class FormPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaFormPlugin

   Private serviceJobForm As JiwaServiceManagerUI.Jobs
      
    Public Overrides Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
    End Sub

    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
      If TypeOf JiwaForm Is JiwaServiceManagerUI.Jobs Then
         serviceJobForm = DirectCast(JiwaForm, JiwaServiceManagerUI.Jobs)
         AddHandler serviceJobForm.Job.Debtor.Read, AddressOf Debtor_Read
      End If
    End Sub
      
   Public Sub Debtor_Read()
      If serviceJobForm.Job.IsReading = False Then
         Msgbox("debtor is : " & serviceJobForm.Job.Debtor.AccountNo, MsgBoxStyle.OkOnly, "Debtor")
      End If
   End Sub
End Class


Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Using the Jiwa Assemblies from a .NET application

Postby indikad » Tue May 20, 2014 5:09 pm

Think I progressed a little bit. below is my new code. However now I want to access that old Cancel parameter that existed in 6.5.13 so I can stop a user from continuing for example - a save.

Code: Select all

Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
      If TypeOf JiwaForm Is JiwaServiceManagerUI.Jobs Then         
            Dim JobForm As JiwaServiceManagerUI.Jobs = DirectCast(JiwaForm, JiwaApplication.IJiwaForm)   
   
         AddHandler JobForm.Job.CreateStart  , AddressOf JobCreateStart
         AddHandler JobForm.Job.CreateEnd  , AddressOf JobCreateEnd
         AddHandler JobForm.Job.SaveEnd ,  AddressOf saveEndJob '--- this works      
        End If
    End Sub
   Private Sub saveEndJob
         MessageBox.Show("blah")
   End Sub
   Private Sub JobCreateEnd( sender As Object ,  e As System.EventArgs )
      Dim jb As JiwaServiceManager.Job  = sender
      MessageBox.Show ("crete end name = " &  " " & jb.Debtor.Name  )
      MessageBox.Show ("crete end is on hold = " &  " " & jb.Debtor.OnHold   )
   End Sub
   Private Sub JobCreateStart    ( sender As Object ,  e As System.EventArgs )
      MessageBox.Show ("crete start "  )      
   End Sub
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Using the Jiwa Assemblies from a .NET application  Topic is solved

Postby Mike.Sheen » Wed May 21, 2014 3:48 pm

Hi Indika,

I think you replied to the wrong post :o I've moved your post to the current thread, which i think is the one you intended to post in.

Throw a new JiwaApplication.Exceptions.ClientCancelledException to cause the application to fail silently.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Service Job getting debtor informaiton on Job start

Postby indikad » Tue Jun 03, 2014 5:31 pm

Thanks Mike.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron