on 10-18-2012 9:05 AM
Hello,
I want to add a new tab folder in Business Partner Master Data and also add some specific items in that folder.I am new to sdk so I don't know.
Anybody who knows please help me.
Hi,
You need to catch the After Form Load event of the form 134 (BP Form) and then execute this code,
Dim oFolder As SAPbouiCOM.Folder = Nothing
Dim oItem As SAPbouiCOM.Item
Dim oItemRef As SAPbouiCOM.Item = Nothing
Dim iMaxPane As Integer = 0
oItemRef = form.Items.Item("9")
oItem = form.Items.Add("MyFld", BoFormItemTypes.it_FOLDER)
oItem.Top = oItemRef.Top
oItem.Height = oItemRef.Height
oItem.Left = oItemRef.Left + oItemRef.Width
oItem.Width = oItemRef.Width
oItem.Visible = True
oFolder = oItem.Specific
oFolder.Caption = "My Folder"
oFolder.GroupWith(oItemRef.UniqueID)
oFolder.Pane = 11
'Create a matrix on the folder
oItem = form.Items.Add("MyMtx", BoFormItemTypes.it_MATRIX)
oItem.FromPane = 11
oItem.ToPane = 11
oItemRef = form.Items.Item("21")
oItem.Top = oItemRef.Top
oItem.Left = 10
oItem.Width = form.Width - 200
oItem.Height = 270
The code should add a folder and a matrix inside it.
For more information on handling system form, you should check out SAP sample in your C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\11.SystemFormManipulation
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Translated in C#
SAPbouiCOM.Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
SAPbouiCOM.Folder oFolder = null;
SAPbouiCOM.Item oItem = null;
SAPbouiCOM.Item oItemRef =null;
oItemRef = form.Items.Item("9") ;
oItem = form.Items.Add("MyFld", BoFormItemTypes.it_FOLDER) ;
oItem.Top = oItemRef.Top ;
oItem.Height = oItemRef.Height ;
oItem.Left = oItemRef.Left + oItemRef.Width ;
oItem.Width = oItemRef.Width ;
oItem.Visible = true ;
oFolder = (SAPbouiCOM.Folder)oItem.Specific;
oFolder.Caption = "My Folder" ;
oFolder.GroupWith(oItemRef.UniqueID) ;
oFolder.Pane = 99 ;
//Create a label on the folder
oItem = form.Items.Add("MyLabel", BoFormItemTypes.it_STATIC) ;
oItem.FromPane = 99 ;
oItem.ToPane = 99 ;
oItemRef = form.Items.Item("21") ;
oItem.Top = oItemRef.Top ;
oItem.Left = 10 ;
SAPbouiCOM.StaticText oLbl = (SAPbouiCOM.StaticText)oItem.Specific;
oLbl.Caption = "MyLabel";
//Create a label on the folder
oItem = form.Items.Add("MyEdit", BoFormItemTypes.it_EDIT);
oItem.FromPane = 99;
oItem.ToPane = 99;
oItemRef = form.Items.Item("MyLabel");
oItem.Top = oItemRef.Top;
oItem.Left = oItemRef.Left + oItemRef.Width + 10;
You have to catch another event to switch your pane level also :
In your After Item Pressed event for form 134 put this codes :
SAPbouiCOM.Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
switch (pVal.FormTypeEx)
{
case "134":
if (pVal.ItemUID == "MyFld" && pVal.BeforeAction==false)
form.PaneLevel = 99;
break;
}
Note that I modified the PaneLevel to 99 in C# codes, in SBO 88 above, pane 11 is used for attachment screen.
Regards
Edy
Hi Kunika,
You need to create a UDF for the BP Master Data,
I will assume that a UDF has been created with the UID = TestBP
Then you just bind the 'txtMyEdit' with the UDF.
Add these Lines after the EditText creation :
SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oItem.Specific;
oEdit.DataBind.SetBound(true, "OCRD", "U_TestBP");
Please close this discussion as answered, if you are done.
Thanks,
Edy
Hi Kunika,
You can read more about this here.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
13 | |
10 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.