System Form Handle
I have a system form that I'd like to use to be able to select sales orders.
The form can be found through Sales A/R -> Delivery -> Sales Order button and is called "List of Sales Orders" with an ID of 10016.
The only way I've managed to load it up is by calling Application.ActivateMenuItem(Delivery MenuUID) and then activating the click event on the "Sales Order" (#36) button of the form. I can then get a handle on the form, but doesn't look very good to the user.
Any ideas as to how I can access this form more directly?
Sorry Trinidad, I've just come back to my code where I need to add this ChooseFromList and am having trouble.
I'm trying to assign this SalesOrder ChooseFromList to an EditText. Can you point out what is wrong with the code:
Dim itmOrder As Item = form.Items.Item("tbOrder")
Dim tbOrder As EditText = itmOrder.Specific
Dim ds As UserDataSource = form.DataSources.UserDataSources.Add("dsSalesOrder", BoDataType.dt_SHORT_TEXT, 10)
tbOrder.DataBind.SetBound(True, "", "dsSalesOrder")
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCFL As SAPbobsCOM.ChooseFromList
Dim oCFLParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLParams = B1Connections.theAppl.CreateObject(BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLParams.MultiSelection = False
oCFLParams.ObjectType = "17"
oCFLParams.UniqueID = "cflDispatchSalesOrder"
'oCFL = oCFLs.Add()
oCFL = form.ChooseFromLists.Add(oCFLParams)
tbOrder.ChooseFromListUID = "cflDispatchSalesOrder"
tbOrder.ChooseFromListAlias = "cflDispatchSalesOrderAlias"
Thanks in advance for your help again.
Similar Messages
-
How to create add-on of a system form in sap b1 9.0?
Hi all,
I have a problem related to the creation of a system form add-on of sap b1 9.0.
I can develop some projects in visual basic, but about sap b1 add-on, I know how to package files of to install (.ard and .exe files) and I also know how to register .ard file in sap b1 9.0, So I tried to register all projects found in SDK sample folder that was correct.
I tried to do an example of project found in SDK Help Center.
But the problem I have to day related to the creation of system form add-on.
The steps I tried to do are:
1. I opened SAP B1 Studio for Microsoft Visual Studio
2. Right click my project and add the system form (Employee Master Data)
3 Connection string I used in Command line arguments 0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
4. I added one field (CFL of BPCode) to Employee Master Data. I did n't add any reference because when I add UI API Vission 9.0 to system form or user form of sap b1 it gives errors in Menu.vb. I do know why.
5. I converted in 32 bit and build my project
6. I re_opened new visual studio 2010 for creating new project with SAP B1 AddOnInstaller.NET Wizard
7. From here I did every thing according to the video of Bryan Gomez
Creating and Registering SAP Add-on - YouTube
8. I registered my .ard file
9. But when I start my add-on it gives error (Add-on connection timed out)
The questions I want to ask,
1. If you are creating the add-on of system form Is there any other thing needed to do more than the above I explained?.
2. Is it necessary to go in SDK code when you are using the system form like that?.
3. If it is necessary to add reference of UI API in project, how to handle error occurs when we add that the reference to the project which is using a system form?.
Please anyone who has an idea he/she can help me.Hi pallavi p,
That's good but as I said above when I add the reference of UI API Version 9.0 in the project which has the system form or user form of sap b1 it exactly gives errors in menu.vb of the project.
So let me give you the way you can try.
1. Open new project/ visual basic/ sap business one/ sap business one add-on project. and save it any where
2. Right click on your project
3. Add new item
4. Sap Business One
5. System form (Employee master data) or user form
6. Add
And then if your form is opened
7. Go to add the reference of UI API Version 9.0
8. Check errors found in menu.vb (or in OutPut)
So if it's possible try to solve that problem.
Please anyone can help me. -
Is it possible to create an additional matrix on a system form? If so, how? I would greatly appreciate a code sample for doing this. Thank you.
hello Scott,
You need to catch the et_Form_Load event of your form, and then you can add the matrix the same way you add matrix on user form.
Public Sub Handle_SBO_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApplication.ItemEvent
If pVal.BeforeAction = False Then
If pVal.FormTypeEx="FormType of the system form" then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD Then
Dim oFom as SAPbouiCOM.Form
oForm = oApplication.Forms.Item(FormUID)
Dim oItem As SAPbouiCOM.Item
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumns As SAPbouiCOM.Columns
Dim oColumn As SAPbouiCOM.Column
oItem = oForm.Items.Add("UMatrix", it_Matrix)
oItem.Top=100
oItem.Left=100
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
oColumn = oColumns.Add("#", it_EDIT)
oColumn.TitleObject.Caption = "#"
oColumn = oColumns.Add("A", it_EDIT)
oColumn.TitleObject.Caption = "A"
oColumn = oColumns.Add("B", it_EDIT)
oColumn.TitleObject.Caption = "B"
End if
End if
end if
End Sub -
System Form Manipulation under Condition
Dear All,
I want to modify a System Form like (Sales Order) in a specific way (eg add folder), when I trigger a user specific Item Menu (eg Order Requisition).
If I use _ItemEvent... (pVal.FormType = 142) everytime the System form is loaded it will change, but I want this happen ONLY WHEN IS TRIGGERED from Specific Item Menu.
I tried the following code but no luck.
Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
If pVal.BeforeAction = False Then
Select Case pVal.MenuUID
Case "SM_PurReq"
DrawPurReqForm()
End Select
End If
End Sub
========
Sub DrawPurReqForm()
SBO_Application.ActivateMenuItem("2305") 'to get Sales Order form
Dim oItem As SAPbouiCOM.Item
Dim f As SAPbouiCOM.Form
f = SBO_Application.Forms.Item("142")
oItem = f.Items.Item("138")
oItem.Visible = False
End Sub
Thanks in Advance,
Vangelis
Edited by: Vangelis Kanellopoulos on Jul 12, 2008 12:54 PMHi Vangelis,
I think this would work:
1) Create a global boolean variable. Set its value to false by default.
2) Add code to the load event of the sales order form that will add your item if the global flag is true. The code should set the global flag to false after the item is added.
3) Add code to the menu event that checks for your menu activation and then sets the global flag to true and activates the sales order menu.
This will mean that the code in the sales order form load event will only be triggered if the sales order form is opened via your menu. If the user opens the sales order form by any other means (eg drag-and-relate, menu or link) then your item will not be added.
Kind Regards,
Owen -
Problem catching events after opening system form
Hi
In my addon i open a system form from a user form. after closing the system form , my user form does not cause any event to be handled by my addon. in other words pressing on the forms button items does not cause any event to accure. in order for the form to work i need to close the form and reopen it from the menu. question is how can i know what is causing the form to stop responding and how can i fix it?
appreciate the help
YoavHi Yoav,
It looks like when the system, form closes you remove a filter for your user form or your remove the listener for your user form.
Regards
Ad -
Adding a button when a system form is opened
Hiya, I'm trying to add a button to a system form in vb.net. For some reason when i run my code the button will add to the form succesfully only when I have that form open in SAP. If the form isn't open I get the error 'Form - Not found' Can anyone show how to just add the button when the user opens the form rather than the button appearing from the form being already open.
My code is like this:
Private Sub SBO_Application_ItemEvent(ByVal FormType As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
If pVal.FormType = 152 And pVal.BeforeAction = False Then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And Not pVal.BeforeAction Then
CreateMySimpleForm()
End If
End If
End Select
End Sub
Public Sub CreateMySimpleForm()
Dim oItem As SAPbouiCOM.Item
Dim oButton As SAPbouiCOM.Button
oForm = SBO_Application.Forms.GetForm("152", 0)
oItem = oForm.Items.Add("51", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Left = 88
oItem.Width = 95
oItem.Top = 558
oItem.Height = 21
oItem.FromPane = 24
oItem.Visible = True
oButton = oItem.Specific
oButton.Caption = "View Document"
oForm.Visible = True
oForm.Update()
End Sub
Any help would be appreciatedok guys I've solved the problem.....this code adds a button to the Open Items List and its in vb.net
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If ((pVal.FormType = 152 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
Try
oItem = oForm.Items.Add("ViewDocBtn", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Left = 88
oItem.Width = 95
oItem.Top = 295
oItem.Height = 21
oItem.Visible = True
oButton = oItem.Specific
oButton.Caption = "View Document"
oForm.Visible = True
oForm.Update()
Catch
SBO_Application.MessageBox("button not added")
End Try
End If
End If
End Sub -
Hi,
I expanded the width of the Sales Quotation system form and move fields to the right to allow space for new fields in the centre.
I used the oForm.Width to adjust this.
If I load the form, expand to full screen, everyhting is in the right place and looks good. However, if i adjust the form dimensions slightly and then expand to full screen the form items, system and user defined, overlap or get lost under the central tab area etc etc. To recover I have to resize the form so both X and Y scroll bars appear, close the form, and then load the form so that it appears with its system minimum dimensions.
Has anyone else experienced this? I also notice that another parameter for forms is oForm.Clientwidth, what is the difference as I can't make this work either???
I can release my addon if someone wishes to try this and see what I am experiencing or I can upload photos.
I think it just that the addon need to take care of dynamic form sizing - cater for resizing events?
Any Ideas???Right, Iam in the middle of my new version but this is the snippet of code that causes the problem, if not clear from this then I'll email code out later.
Private Sub oApp_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApp.ItemEvent
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pVal.FormType = 149 And pVal.Before_Action = True Then
Try
Dim oItem As SAPbouiCOM.Item
Dim oForm As SAPbouiCOM.Form
Dim oCombo As SAPbouiCOM.ComboBox
Dim oEdit As SAPbouiCOM.EditText
Dim oLabel As SAPbouiCOM.StaticText
Dim oXplaneItem As SAPbouiCOM.Item
Dim oYplaneItem As SAPbouiCOM.Item
Dim iUnitMove As Integer
Dim iCentralLocation As Integer
Dim iBottomCentralLoc As Integer
oForm = oApp.Forms.Item(FormUID)
'Constants
iCentralLocation = 75
iBottomCentralLoc = 40
iUnitMove = 350
'Add fields to Table for new Editbox fields
oForm.DataSources.DBDataSources.Add("OQUT")
'Rename "Owner" static text to "FSE"
oItem = oForm.Items.Item("230")
oLabel = oItem.Specific
oLabel.Caption = "FSE"
'Move Top RIght Fields to create space in middle for new date fields
oForm.Width = oForm.Width + iUnitMove
oForm.Items.Item("9").Left = oForm.Items.Item("9").Left + iUnitMove
oForm.Items.Item("88").Left = oForm.Items.Item("88").Left + iUnitMove
oForm.Items.Item("8").Left = oForm.Items.Item("8").Left + iUnitMove
oForm.Items.Item("60").Left = oForm.Items.Item("60").Left + iUnitMove
oForm.Items.Item("81").Left = oForm.Items.Item("81").Left + iUnitMove
oForm.Items.Item("11").Left = oForm.Items.Item("11").Left + iUnitMove
oForm.Items.Item("10").Left = oForm.Items.Item("10").Left + iUnitMove
oForm.Items.Item("86").Left = oForm.Items.Item("86").Left + iUnitMove
oForm.Items.Item("46").Left = oForm.Items.Item("46").Left + iUnitMove
'Move bottom right fields to create space in middle for new fields
oForm.Items.Item("23").Left = oForm.Items.Item("23").Left + iUnitMove
oForm.Items.Item("22").Left = oForm.Items.Item("22").Left + iUnitMove
oForm.Items.Item("25").Left = oForm.Items.Item("25").Left + iUnitMove
oForm.Items.Item("24").Left = oForm.Items.Item("24").Left + iUnitMove
oForm.Items.Item("283").Left = oForm.Items.Item("283").Left + iUnitMove
oForm.Items.Item("42").Left = oForm.Items.Item("42").Left + iUnitMove
oForm.Items.Item("90").Left = oForm.Items.Item("90").Left + iUnitMove
oForm.Items.Item("91").Left = oForm.Items.Item("91").Left + iUnitMove
oForm.Items.Item("89").Left = oForm.Items.Item("89").Left + iUnitMove
oForm.Items.Item("99").Left = oForm.Items.Item("99").Left + iUnitMove
oForm.Items.Item("27").Left = oForm.Items.Item("27").Left + iUnitMove
oForm.Items.Item("30").Left = oForm.Items.Item("30").Left + iUnitMove
oForm.Items.Item("29").Left = oForm.Items.Item("29").Left + iUnitMove
'Move "Copy From" & "Copy To" buttons
oForm.Items.Item("10000330").Left = oForm.Items.Item("10000330").Left + iUnitMove
oForm.Items.Item("10000329").Left = oForm.Items.Item("10000329").Left + iUnitMove
'Expand Grid in Contents Tab to fit form again
oForm.Items.Item("115").Width = oForm.Items.Item("115").Width + iUnitMove
oForm.Items.Item("116").Width = oForm.Items.Item("116").Width + iUnitMove
oForm.Items.Item("38").Width = oForm.Items.Item("38").Width + iUnitMove
oForm.Items.Item("118").Left = oForm.Items.Item("118").Left + iUnitMove
oForm.Items.Item("65").Left = oForm.Items.Item("65").Left + iUnitMove
oForm.Items.Item("75").Left = oForm.Items.Item("75").Left + iUnitMove
'Move Items in Logisitcs Tab
oForm.Items.Item("233").Left = oForm.Items.Item("233").Left + iUnitMove
oForm.Items.Item("223").Left = oForm.Items.Item("223").Left + iUnitMove
oForm.Items.Item("238").Left = oForm.Items.Item("238").Left + iUnitMove
oForm.Items.Item("224").Left = oForm.Items.Item("224").Left + iUnitMove
oForm.Items.Item("234").Left = oForm.Items.Item("234").Left + iUnitMove
oForm.Items.Item("234").LinkTo = "224"
'Move Items in accounting tab
oForm.Items.Item("156").Left = oForm.Items.Item("156").Left + iUnitMove
oForm.Items.Item("157").Left = oForm.Items.Item("157").Left + iUnitMove
oForm.Items.Item("119").Left = oForm.Items.Item("119").Left + iUnitMove
oForm.Items.Item("120").Left = oForm.Items.Item("120").Left + iUnitMove
oForm.Items.Item("124").Left = oForm.Items.Item("124").Left + iUnitMove
oForm.Items.Item("123").Left = oForm.Items.Item("123").Left + iUnitMove
oForm.Items.Item("135").Left = oForm.Items.Item("135").Left + iUnitMove
oForm.Items.Item("134").Left = oForm.Items.Item("134").Left + iUnitMove
'Hide system predicted closing date as picks 1 month later if not completed
oForm.Items.Item("12").Visible = False
oForm.Items.Item("13").Visible = False
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
If you try this in debug mode, you will still see the system forms items affected in the way I have described.
Edited by: David Alexander on Oct 14, 2008 1:32 PM -
Transaction control after we press 'add' in system forms
Hi All,
I want to perform a transasction in goods issue for the same items which user enters in goods recipt form. when he presses 'Add' in goods receipt form, ideally first, receipt document will be generated by default (thru system only) and then thru SDK's oInventoryGenExit object, I m passing the same document to issue but, I want to let the receipt be created first and then only if the receipt is created successfully, Issue will be generated. but, in practice, the issue is executed first.
Is there any way to track if user has clicked "yes"
for "you can not change the document after you have added it.
do u want to continue?" message, after he presses 'Add'?.
Ideally, issue document should be generated after user clicks yes and reciept is generated.
thanks in advance.
regards,
BinitaHi All,
the workarounds we discussed work fine. I m facing one more problem. After the system form succesfully adds the data (and we get the confirmation by checking the action success or something like that) , how can I know which was the last document added by that form? for example, I am handling the Form Data Event in sales order form and checking the action success. but, I want to know which was the document created by this event in back-end. we can do it by comparing the document number from form screen, but we know that, for cases such as more than one users adding the documents simultaneously or when a draft is saved as document, the shown doument number may not be the actual number with which the document may have been saved in back-end table.
How can I determine this?
Any help would be greatly appreciated as I m just stuck up on this
thanks and regards,
Binita -
Opening system forms without menu
Hi All,
Does there exist code to open a system form, like the Production Order, without activating the menu item that calls it? For example, I would like to open a production order form with a given instance? The reason for this is that I need to open the form and then load it with a specific production order. Because it is possible for there to be any number of production order forms open simultaneously at any given time, I need to know the exact form I had just opened in order to load it.
Is this possible?
Thanks,
MikeHi Mike,
it's possible, I guess.
But you have to the actual operation of opening form and finding production order by addon.
You can use 'activate menuitem' clause, first.
then you should enter the number of the production order which you want to open to the order number field in number field. (you can do it via handling UI items.) then use the 'click' method of the item number "1". it's generally possible. I did it sometimes.
Hope this useful for you. -
hi kings
i m trying to change the system opportunity forms. i just add one folder the folder contain matrix... i take the example programs(system manipulation)..the folder added.. the matrix also added.. but unfortunately the matrix not allow to enter the data and how to save the data .... here i pasted full codings....please any one help me...
Code....
Public Class SystemForm
Private WithEvents SBO_Application As SAPbouiCOM.Application
Private oOrderForm As SAPbouiCOM.Form
Private oNewItem As SAPbouiCOM.Item
Private oItem As SAPbouiCOM.Item
Private oFolderItem As SAPbouiCOM.Folder
Private oOptionBtn As SAPbouiCOM.OptionBtn
Private oCheckBox As SAPbouiCOM.CheckBox
Private oMatrix As SAPbouiCOM.Matrix
Private oColumns As SAPbouiCOM.Columns
Private oColumn As SAPbouiCOM.Column
Private i As Integer '// to be used as a counter
Private Sub SetApplication()
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
SboGuiApi = New SAPbouiCOM.SboGuiApi()
sConnectionString = Command
SboGuiApi.Connect(sConnectionString)
'// get an initialized application object
SBO_Application = SboGuiApi.GetApplication()
End Sub
Private Sub AddItemsToOrderForm()
oOrderForm.DataSources.UserDataSources.Add("OpBtnDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
oOrderForm.DataSources.UserDataSources.Add("CheckDS1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
oOrderForm.DataSources.UserDataSources.Add("CheckDS2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
oOrderForm.DataSources.UserDataSources.Add("CheckDS3", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
oItem = oOrderForm.Items.Item("7")
For i = 1 To 3
oNewItem = oOrderForm.Items.Add("CheckBox" & i, SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
oNewItem.Left = oItem.Left
oNewItem.Width = 100
oNewItem.Top = oItem.Top + (i - 1) * 19
oNewItem.Height = 19
oNewItem.Visible = False
oNewItem.FromPane = 5
oNewItem.ToPane = 5
oCheckBox = oNewItem.Specific
'// set the caption
oCheckBox.Caption = "Check Box" & i
'// binding the Check box with a data source
oCheckBox.DataBind.SetBound(True, "", "CheckDS" & i)
Next i
'// Adding Option button items
'// use an existing item to place youe item on the form
'oItem = oOrderForm.Items.Item("44")
For i = 1 To 3
oNewItem = oOrderForm.Items.Add("OpBtn" & i, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)
oNewItem.Left = oItem.Left
oNewItem.Width = 100
oNewItem.Top = oItem.Top + (i - 1) * 25
oNewItem.Height = 19
oNewItem.Visible = False
'// set the Item's Pane Level.
'// this value will determine the Items visibility
'// according to the Form's pane level
oNewItem.FromPane = 9
oNewItem.ToPane = 9
oOptionBtn = oNewItem.Specific
'// set the caption
oOptionBtn.Caption = "Option Button" & i
If i > 1 Then
oOptionBtn.GroupWith("OpBtn" & i - 1)
End If
oOptionBtn.DataBind.SetBound(True, "", "OpBtnDS")
Next i
End Sub
Private Sub AddMatrixToForm()
'// we will use the following object to add items to our form
Dim oItem As SAPbouiCOM.Item
'// we will use the following object to set a linked button
Dim oLink As SAPbouiCOM.LinkedButton
'// Adding a Matrix item
oItem = oOrderForm.Items.Item("7")
oItem = oOrderForm.Items.Add("Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
oItem.Left = 35
oItem.Width = 400
oItem.Top = oItem.Top + (i - 1) * 60
oItem.Height = 125
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
oItem.FromPane = 9
oItem.ToPane = 9
'// Adding Culomn items to the matrix
oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "#"
oColumn.Width = 30
oColumn.Editable = False
'// Add a column for BP Card Code
oColumn = oColumns.Add("DSCardCode", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)
oColumn.TitleObject.Caption = "Item Code"
oColumn.Width = 150
oColumn.Editable = True
'// Link the column to the BP master data system form
oLink = oColumn.ExtendedObject
oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
'// Add a column for BP Card Name
oColumn = oColumns.Add("DSCardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Description"
oColumn.Width = 150
oColumn.Editable = True
'oColumn.DataBind.SetBound(true, "TableName", "U_ItemNo")
'// Add a column for BP Card Phone
oColumn = oColumns.Add("DSPhone", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Quantity"
oColumn.Width = 70
oColumn.Editable = True
End Sub
Public Sub New()
MyBase.New()
SetApplication()
End Sub
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If ((pVal.FormType = 320 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
'// get the event sending form
oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
'// add a new folder item to the form
oNewItem = oOrderForm.Items.Add("UserFolder", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oOrderForm.Items.Item("7")
oNewItem.Top = oItem.Top
oNewItem.Height = oItem.Height
oNewItem.Width = oItem.Width
oNewItem.Left = oItem.Left + oItem.Width
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "User Folder"
'// group the folder with the desired folder item
oFolderItem.GroupWith("7")
'// add your own items to the form
AddItemsToOrderForm()
AddMatrixToForm()
oOrderForm.PaneLevel = 1
End If
If pVal.ItemUID = "UserFolder" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then
oOrderForm.PaneLevel = 9
End If
End If
End Sub
Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes)
Select Case EventType
Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown
'// Take care of terminating your AddOn application
SBO_Application.MessageBox("A Shut Down Event has been caught" & _
vbNewLine & "Terminating 'Order Form Manipulation' Add On...")
End
End Select
End Sub
End Class
Thanks & Best Regards
B.Lakshmi NarayananEvents Part
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If ((pVal.FormType = 320 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
'// get the event sending form
oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
'// add a new folder item to the form
oNewItem = oOrderForm.Items.Add("UserFolder", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
'// use an existing folder item for grouping and setting the
'// items properties (such as location properties)
'// use the 'Display Debug Information' option (under 'Tools')
'// in the application to acquire the UID of the desired folder
oItem = oOrderForm.Items.Item("7")
oNewItem.Top = oItem.Top
oNewItem.Height = oItem.Height
oNewItem.Width = oItem.Width
oNewItem.Left = oItem.Left + oItem.Width
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "User Folder"
'// group the folder with the desired folder item
oFolderItem.GroupWith("7")
'// add your own items to the form
AddItemsToOrderForm()
AddMatrixToForm()
oOrderForm.PaneLevel = 1
End If
'If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Before_Action = True Then
'oOrderForm.PaneLevel = 5
'End If
If pVal.ItemUID = "UserFolder" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then
'// when the new folder is clicked change the form's pane level
'// by doing so your items will apear on the new folder
'// assuming they were placed correctly and their pane level
'// was also set accordingly
oOrderForm.PaneLevel = 9
End If
End If
End Sub
Thanks & Best Regards
B.Lakshmi Narayanan -
Hi together,
I have a problem with using the BubbleEvent in combination with System-Form-Events:
Target:
If someone CLICK on the OK-Button in Systemform "134"
(Business-Partners-Form), I want to stop the Form being closed.
Concept:
using the Item-Event "et_ITEM_PRESSED" and set the BubbleEvent-Flag to false.
Sample-Code:
If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And _
(pVal.FormMode = SAPbouiCOM.BoFormMode.fm_OK_MODE) And _
(pVal.FormTypeEx.Equals("134") = True) And _
(pVal.ItemUID.Equals("1") = True) And _
(pVal.BeforeAction = True) Then
Try
BubbleEvent = False
Catch ex As Exception
'check Errors
End Try
End If
Problem and Test:
Nevertheless the form is being closed. The BubbleEvent-Flag has no effect. As I read in other topics, the 2005 Environment only accept the Bubble-Event in BeforeAction.
Three Events will be fired (Click on OK-Button):
et_Click | beforeAction = true
et_Click | beforeAction = false
et_Item_pressed | beforeAction = true
I have used the last Event (Item_pressed). Using the et_Click with beforeAction = true has also no effect.
The events will always be used individually at the test, not combined.
Maybe someone can resolve this problem...
Best regards
JochenStrange. I implemented a very simple add-on with B1DE
and added this listener:
public class Button__134__1 : B1Item {
public Button__134__1() {
FormType = "134";
ItemUID = "1";
[B1Listener(BoEventTypes.et_ITEM_PRESSED, true)]
public virtual bool OnBeforeItemPressed(ItemEvent pVal) {
Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
Item item = form.Items.Item("1");
Button button = ((Button)(item.Specific));
// ADD YOUR ACTION CODE HERE ...
return false;
As you can read this listener set the bubble event to
false for the button 1 in Form 134. The form cannot be
closed, the event is handled correctly by the add-on. I am
using 2005 SP1 but I guess it should be working the same
for your release too. -
Problem with AddRow() in custom matrix on System Form
Hello all,
I'm trying to add 1 row to a custom matrix on a system form (Sales Quotation).
However I always get a RPC_E_SERVERFAULT exception when calling pMatrix.AddRow() and SBO crashes...
My code is simple:
[B1Listener(BoEventTypes.et_CLICK, false)]
public virtual void OnAfterClick(ItemEvent pVal)
Form pForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
// Add matrix line
Matrix pMatrix = (Matrix) pForm.Items.Item("MATRIX").Specific;
pMatrix.AddRow();
// Set matrix line data
The matrix shows ok in the system form, inside a new folder.
What is the problem with my code?
Is there any way to add rows to a custom matrix in a system form?
This code runs ok if executed in a custom form...
Thanks!
Manuel Diashi.
R u facing any problem ...
actually add row and del row both are same.
in normal customization form and system form matrx...
Any problem are u facing... -
How to Refresh System Form in Run Time
Dear All,
Please give me idea for Refresh System Document in Run Time using DI,basically I am using system columns for update for some scenarios.
So please give solution that how should refresh system form.
Thanks a lot.
Ashish Singh.Hi,
Please post above discussion in SDK forum.
Thanks & Regards,
Nagarajan -
!0.5.8 How do I copy the 'system' form one internal Hard drive to an other (BY CD Packed up) I have tried but it will no show 'live' system folder - do and how can I bless it ? Thank you
Carbon Copy Cloner will allow you to de-select directory trees, so you could use it to copy over everything EXCEPT the /Users directory tree.
Mac OS X is NOT just the System Folder. If you do not copy over the rest of Mac OS X, it will not boot. So better to exclude Users and take everything else, then it is to try and pick and choose.
The other approach is to install a New Mac OS X, and then copy over the stuff you want from the home folder(s) and reinstall any apps you want. -
How to register add-on of edited system form in sap b1 9.0?.
Hi all,
I have a problem in SAP b1 9.0.
Actually I added one field of BPCode to Employee master data, so I want to register an add-on of that system form in SAP b1 9.0.
When I create file of .ard as we watch it in video of
Bryan Gomez
Creating and Registering SAP Add-on - YouTube it will be created correctly, But the problem is when I register that the file of .ard it gives error (Cannot create a file when that file already exists). Again when I create a file of .ard of any other User form it gives the same error (Cannot create a file when that file already exists).
But when I create and register the add-on of Hello World in Sample folder of SDK it will be registered correctly.
How can I solve that problem.
Anyone can help me please.Hi pallavi p,
That's good but as I said above when I add the reference of UI API Version 9.0 in the project which has the system form or user form of sap b1 it exactly gives errors in menu.vb of the project.
So let me give you the way you can try.
1. Open new project/ visual basic/ sap business one/ sap business one add-on project. and save it any where
2. Right click on your project
3. Add new item
4. Sap Business One
5. System form (Employee master data) or user form
6. Add
And then if your form is opened
7. Go to add the reference of UI API Version 9.0
8. Check errors found in menu.vb (or in OutPut)
So if it's possible try to solve that problem.
Please anyone can help me.
Maybe you are looking for
-
How to upgrade OS X v10.5 to OS X v10.6?
i"ve an old Imac running on OS X v10.5.8, Any advice how to upgrade to OS X v10.6 Snow would be invaluable. Thanks
-
Re : partial Amounts has been pay to APP
hi kings I have one doubt, that is I want to Run Automatic payment program to partial amounts that is possiable or not. Please let me confirm to me. If possiable what are the steps are required.
-
I cant figure out how to change my security questions
i cant find out where to change my security questions
-
Bravia kdl-32bx300 hdmi 1 malfunctionbravia kdl-32bx300 hdmi 1 malfunction
i have a sony bravia kdl-32bx300 and yesterday my HDMI1 malfunctioned i have my computer and/or netflix box doesn't matter which one is plugged into HDMI1 after about 10 minutes of either device running on HDMI1 the TV shuts off and won't come back o
-
Hello, we need to add a mailbody text to a standard mail (e.g. sales order confirmation using program SAPMV45A). The output type was defined using transaction NACE with application V1 and medium 5 (external sending). Currently we have only the PDF at