Calling Objects from my client events....

  • 29 March 2012
  • 2 replies
  • 1 view

Badge +3

Hi,


Thanks again for the much needed assistance.


Now I have a major problem. I am upgrading a process from 2003 to blackpearl, and in 2003 I used a kcm. For the kcm's substitue in blackpearl I was advised to drag a Server Event on to the Canvas and add my code there, which I have done.


In the kcm in 2003, I had a ServerEventContext method


(Public Function CheckIfStockAvaliable(ByVal K2 As ServerEventContext) As Boolean).


I would reference that method from my other event in the actual kpr oStockRoutines.CheckIfStockAvaliable(K2)


under Sub Main(ByVal K2 As ServerEventContext) , and that worked fine.


In Blackpearl, it is not that easy.


I have got public void Main(Project_79f10eadebdc4f45ad863ebfc87efd30.EventItemContext_4f23cb94bd4a4714b2912ad6f5f05f2d K2) in my Server Event,


and when I try to call a method from there,


oStockRoutines.CheckIfStockAvaliable(K2);,


 it errors that the arguments are invalid. Please help...


2 replies

Badge +10

Hi,


I believe you can get the server context by calling the K2.GetServerContext() method which you can then pass into your CheckIfStockAvailable() method. e.g. oStockRoutines.CheckIfStockAvailable(K2.GetServerContext());


This should function the same as it did in K2.net 2003.


Let me know if if works.


Regards,

Badge +3

Hi Johan,


Long time no see/talk/chat. Hope you are well.


Yes, your solution definately sorted me out, as usual......


Thank you very much.


 

Reply