Hook on Purchase Order

May 07, 2005 6 Replies

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


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

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> >

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

Antonio,

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

CP.Dinesh

"Ant> >

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,

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required