cancel
Showing results for 
Search instead for 
Did you mean: 

SAP B1 Item Event Problem

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

        }
former_member185682
Active Contributor

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

Former Member
0 Kudos

Thanks for your replies,

Thats solved my problem 🙂

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

Hi Ahmet,

Not this part,

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

Regards
Edy

edy_simon
Active Contributor
0 Kudos

Hi Ahmet,

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

Regards
Edy