Hook on Purchase Order

Hi All,

I need to make a hook on purchase order save and get the PO Id to manipulate some data which is entered by the user. I know how to invoke hook by editing registry and specifying Hook type as "SavePurchaseOrder-9" and Parameter as "5" (to pass PO ID).

I made an ActiveX DLL using VB 6 , and its invoking at the time of PO save, but i could't get the PO id. There may be some problem in my coding . So someone who tried this , please give a sample code to retrieve PO id which is passed by hook parameter.

Thanks and Regards, CP.Dinesh

Reply to
C.P.Dinesh
Loading thread data ...

Try with ...

Public Function Process(poID as Integer) as Boolean ' your code Process = True End Function

or

Public Function Process(s as QSRules.SessionClass, poID as Integer) as Boolean ' your code Process = True End Function

antonio

Reply to
Antonio Mazzeo

Hi Antonio,

Thanks a lot. I tried the sample given by you. Both one giving the same warning massage from Manager like,

"Attempt to process COM Object 'MyProject.MyClass' failed.An Unknown error occured"

Can you help..?

My registry setting is this , HookType : 9 ObjectName : MyProject.MyClass Parameter : 5

My Code,

Public Function Process(poID as Integer) as Boolean CallMyMsg Process = True End Function

Public Sub CallMyMsg() Msgbox " I am from PO hook" End Sub

"Ant> >

Reply to
C.P.Dinesh

It's a problem of COM .. because the integer of VB isn't the same integer of COM.

Yes .. I try my code and with this version I receive the Reference ID..

Public Function Process(poID as Long) as Boolean ' blablablablabla :) Process = True End Function

I go back, I return tuesday morning..

bye bye antonio

Reply to
Antonio Mazzeo

Antonio,

My Store operations manager version is 1.2.0151. Did you varified my registry settings ? Is it ok?

CP.Dinesh

"Ant> >

Reply to
C.P.Dinesh

Antonio,

Its working perfectly with your code..

Public Function Process(poID as Long) as Boolean ' blablablablabla :) Process = True End Function

Thank you very much for your help. Have a nice time, bye

CP.Dinesh

"C.P.D> Antonio,

Reply to
C.P.Dinesh

Reply to
Zak

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.