//If there is more than one cockpit in SAP Business One //And every cockpit has more than one widget in it //Get the first widget in the first cockpit SAPbouiCOM.Cockpit ckpt = ckpts.Item(0); SAPbouiCOM.Widgets wdts = ckpt.Widgets; SAPbouiCOM.widget wdt = wdts.Item(0);
//Store the widget UID for subsequent steps string strWidgetUID = wdt.WidgetUID;
//You can retrieve the first one now SAPbouiCOM.widget wdtGet = ckpts.GetWidget(strWidgetUID);