Skip to Content

Enabling Drag and Drop on a UDO Document?

Is it possible to get B1's drag and drop functionality work on a custom UDO Form (SAP B1 9.2 PL03)? I created a UDO Document with rows and customized the form the UDO generated. I could easily grab LinkedObject events, so I can open an Order or SalesOrder system form when the user clicks on a linked button (yellow arrow), by running a database search in the background and calling

Application.OpenForm(BoFormObjectEnum.fo_Order, "", docEntry);

Our users use the drag and drop function daily to find matching records on different documents. Like they drag the ItemCode cell from the SalesOrder document and drop it to the drag and drop menu's Order item. SAP then opens a new window displaying the Orders containing the itemcode dropped. I would like to enable the same functionality on my UDO Form.

By default, I can start dragging any of the cells and drop them to the target drag and drop menus, but SAP just displays and error:

No matching records found (ODBC -2028)  [Report 131-183]

Note: I translated back the original error message back to english, mine is displayed in Hungarian (Nem találhatók megegyezĹ‘ adatrekordok (ODBC -2028) [Jelentés 131-183]).

I expected something similar to the linkedObject solution, like I could grab a drag event and call an Application.OpenForm with parameters to open the SAP search window. Sadly, I couldn't even get the Event to work. The UI help file contains an et_Drag event:

//After you enable the cockpit, when you drag an item, the event named ItemDragEvent will be raised. 
 
private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent) 
 { 
            BubbleEvent = true; 
       if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_Drag) 
            { 
                SAPbouiCOM.ItemDragEvent pItemDrag; 
                pItemDrag = (SAPbouiCOM.ItemDragEvent)pVal; 
 
                if (pItemDrag.TargetFormUID.CompareTo("") != 0) 
                { 
                    oString = pItemDrag.TargetFormType; 
                    string formuid = pItemDrag.TargetFormUID; 
                    int mytop = pItemDrag.Top; 
                    int myleft = pItemDrag.Left; 
                } 
           } 
 }

Which I cannot grab in my application (is it a supported ItemEvent?), because I could not log the event even in the Event Logger (it only logs the Click event even for System forms and the program do not contains a filter for the et_Drag event, so I expect it does not support it).

Also, I could not find any way to open the same result form programmatically which gets opened by the drag and drop events on system forms by default (no sysObjectType or similar Application.Open<Something> method).

Thank you!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers