📚 SAP Business One SDK Help

LinkedButton Object
See Also  Members  Example

Description

Represents an arrow link in a form.

An arrow link enables quick navigation between relevant objects. For example, an arrow link next to the Customer field in the A/R Invoice form opens the Business Partner Master Data form for the relevant customer.

Note: You can also use this feature to link to the UDO default forms and the user-defined forms.

Object Model


Example

Adding a linked button to a matrix (VB.NET)Copy Code
Dim oLink As SAPbouiCOM.LinkedButton
Set oColumn = oColumns.Add("A", it_LINKED_BUTTON)
Set oLink = oColumn.ExtendedObject
oLink.LinkedObject = lf_BusinessPartner
Adding a Linked Button to UDO Forms (C#)Copy Code
// Get B1 application object 
app = m_B1Conn.B1Application; 
             
// Add a form with a linked button. 
fcp = ((SAPbouiCOM.FormCreationParams)(app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams))); 
fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable; 
fcp.FormType = "SAMPLE"; 
fcp.UniqueID = "Linked01"; 
fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed; 
 
my_form = app.Forms.AddEx(fcp); 
 
// Set form size and position 
my_form.Top = 20;             
my_form.Height = 350; 
my_form.Width = 800; 
my_form.Title = "UDO Linked Button"; 
 
my_form.Visible = true; 
 
// Add a text box binded to a user datasource 
my_item = my_form.Items.Add("MyEdit", SAPbouiCOM.BoFormItemTypes.it_EDIT); 
my_item.Left = 100; 
my_item.Top = 100; 
my_item.Width = 30; 
my_item.Height = 30; 
edit = my_item.Specific as SAPbouiCOM.EditText; 
 
oUDS = my_form.DataSources.UserDataSources.Add("DS1", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 200); 
 
edit.DataBind.SetBound(true, "", "DS1"); 
 
edit.Value = "SAP01"; // The key used for the current UDO record 
 
// Add a linked button to the form 
SAPbouiCOM.Item oLinkItem = my_form.Items.Add("lk01", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON); 
oLinkItem.Left = 10; 
oLinkItem.Top = 100; 
oLinkItem.Width = 80; 
oLinkItem.Height = 80; 
 
oLinkItem.LinkTo = "MyEdit"; 
 
oLink = oLinkItem.Specific as SAPbouiCOM.LinkedButton; 
             
// If you want to use the UDO default form, run the UDO wizard and set this UDO to hava a default form. 
oLink.LinkedObjectType = "MyUDO1"; // Change to a UDO that exists in your system. 
 
// If you set this property, the linked button will open a user-defined form 
oLink.LinkedFormXmlPath = @"C:\UDOForm\UDOnewForm.srf"; 
 

See Also