Skip to Content
0

SAP B1 Item Event Problem

Jan 02, 2017 at 01:45 PM

101

avatar image

Hi experts,

I have a problem with ItemEvent,

When i click menu item and create form Item event is running once,

Then i close and re-open the form item event is running twice and then three,four times..

How can i solve this problem?

Thank you for helps,

Regards.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Ahmet Emin Pehlivan Jan 03, 2017 at 11:24 AM
0

Hi Edy,

I am sorry,

Its here,

Regards.

   public SalesOrder()
        {
            SBO_Application = Application.SBO_Application;
        SBO_Application.ItemEvent += new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);

        }
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Ahmet,

As Edy said, probably your code is executed multiple times. I believe this code above is executed everytime when you open your form. If yes, you need detach your event when your form close, like this:

SBO_Application = Application.SBO_Application;
        SBO_Application.ItemEvent -= new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);

But if you have two forms opened at the same time, you will receive this event twice. Then you need to manage for each form only control your own events.

Kind Regards,

Diego Lother

1

Thanks for your replies,

Thats solved my problem :)

0
Edy Simon Jan 03, 2017 at 12:54 AM
0

Hi Ahmet,

Your event handler is registered multiple times.
Please show your code where you add the event handlers.

Regards
Edy

Share
10 |10000 characters needed characters left characters exceeded
Edy Simon Jan 03, 2017 at 09:06 AM
0

Hi Ahmet,

Not this part,

Somewhere there should be a code that is similar to :
SBO_Application.ItemEvent += SBO_Application_ItemEvent(....);

Regards
Edy

Share
10 |10000 characters needed characters left characters exceeded