Skip to Content
0
Mar 12, 2021 at 05:01 PM

Determine DocNum when my button is clicked on Sales Order

93 Views Last edit Mar 12, 2021 at 05:05 PM 2 rev

I've added a button to the standard Sales Order form and get notified when it's clicked. How do I determine the sales order number (DocNum) from the click event?

private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)

{

if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK)

{ // A mouse click happened. See if it was one of our buttons

if (pVal.ItemUID == "IS_CfgBtn") { // My button was clicked

// Here I need to get the document or DocNum so I can retrieve the document