📚 SAP Business One SDK Help

GetWidget Method
See Also  Example
bstrWidgetUID

The unique ID of the widget.

Description

Get the Widget object using a provided widget UID.

Syntax

Visual Basic
Public Function GetWidget( _
   ByVal bstrWidgetUID As String _
) As Widget

Parameters

bstrWidgetUID

The unique ID of the widget.

Example

Getting a Widget by a Provided Widget UID (C#)Copy Code
SAPbouiCOM.Cockpits ckpts = sbo_Application.Cockpits; 
 
//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);

See Also