Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
- {
- BubbleEvent = true;
- _form = _sboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
- try
- {
- if (pVal.FormType == 134 && pVal.FormTypeEx == "134") //Business Partner Master Data
- {
- //write log
- _count++;
- _log.Add("(" + _count.ToString() + ") event: " + pVal.EventType.ToString() + " - before action: " + pVal.BeforeAction + " - ItemUID: " + pVal.ItemUID);
- if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT && false) //used to check id of the combo box item
- {
- string id = pVal.ItemUID;
- }
- if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD && pVal.ActionSuccess)
- {
- _formLoaded = true;
- }
- if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_GOT_FOCUS && pVal.ActionSuccess)
- {
- _hasFocus = true;
- }
- if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE && pVal.ActionSuccess)
- {
- _isActive = true;
- }
- _form = _sboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
- if (_formLoaded && _hasFocus && _isActive)
- {
- // get the event sending form
- FormLoad();
- _hasFocus = false;
- //_isActive = false;
- }
- else if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED && !pVal.Before_Action && pVal.ItemUID == "1")
- {
- add = true; //check if add business partner button has been pressed
- }
- else if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_CLOSE && !pVal.Before_Action)
- {
- if (!add)
- {
- //if not, adding has been canceled -> try to return new code
- bool rolledBack = NumberPool.TryRollbackNumber("BUSPARTNER", newCode);
- }
- //WriteLog();
- }
- else if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD)
- {
- try
- {
- }
- catch (Exception ex) //trying to catch an exception that is only displayed in SBO but not in VS
- {
- Console.WriteLine("BusinessPartnerView.SBO_Application_ItemEvent() form unload Error:");
- Console.WriteLine(ex.Message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement