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 appreciated

ok 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

Similar Messages

  • I have Java set up as a plug in but cann't get into yahoo games. Where is the firefox button when I have the browser open? Only button I see gives me close, resize,

    I have java installed and properly working as a plug in. Why can I not get into Yahoo games and play Card Games? Where is the firefox button when I have the browser open? Only button that looks like anything for firefox allows me to restore, move, size, minimize, maximize, and close. That button is top left hand corner location.

    I recently purchased a second hand new macbook air, although it was second hand to me the previous owner had never actually turned it on.
    Something doesn't make sense here, though I'm not saying the previous owner is lying....
    Time to send your serial # to iTS and let them see what's happening here.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • How to disable the back button when displaying a form

    Hi ,
    i have form A calling form B, when form B is displayed i want to disable the
    back button in the explorer so as not to allow the user from going back to
    form A.
    thanks.

    When you open a new window, call following javascript function also to disable the "back" button.
    window.history.forward(1);
    It will work.

  • How do I add a button to an existing form

    I have seen a few questions similar to this, but I am a total novice to customizing SBO.  This is the procedure as I understand it, please tell me if I am correct. 
    I have to have some application running (call it MyApp).  MyApp contains the code to catch the load event for the form I am intersted in, and add the button then let the form load.  Is that correct?  Then what do I need to do to capture the event caused by pressing the new button?  Ultimately, this exercise will add a button to the Activity form and then cause the screen to refresh when the button is pressed.
    I am NOT asking for someone to do this for me, but I see "pieces" of what I think I want to do in the examples and help, I just want to be sure I am heading in the right direction before getting mired down.
    TIA

    Hi Steve,
    For adding your button to a system form, your approach is correct (ie capture the load event of the form your want to customise and add the button using the UI API or by loading via XML). There is an example of customising a system form in the UI API samples from the SDK. There is also an article on how to use XML to load new controls that can be found here:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ebe72e9e-0301-0010-979e-d37dcd714600
    For capturing the event of the user clicking on your new button, what you need to do is trap the Item Pressed event for that form. I also recommend you look at filtering the events that your addon captures. This is good practice as a lack of event filtering can cause significant performance issues.
    Kind Regards,
    Owen

  • How to show system form with a new button

    Hi experts,
         I created a new button on the sales order system form, I need that the new button calls other system form, How can I show a system form with my new button?
    Thaks.
    César Lemus.

    Hi César,
    On the Item Pressed Event of the button, Write the code to show the other system form. The sample for this is as follows.
    Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                          If pVal.ItemUID = "URButtonID"
                                    SBO_Appln.ActivateMenuItem("Menu ID of ur system form.")
                          EndIF
    Hope this is helpful. If yes reward points.
    Regards,
    Vasu Natari.

  • To get the button on system form without using ADDON

    Hello,
    I want to get the new button on tne System Form without creating or using Add-on.
    And while clicking on that button, i want to display "Hello World" message..
    Can u please tell me how to get new button on the System form without using AddOn?
    Thanks
    Nisha

    Hi Nisha,
    It is not possible to add a button on a system form without using an add-on, this is because in order to add a button an a system form you have to access its form id at run time (that converts this standard form into a customized form for your add-on ) the location of some existing control that will be taken as the base location identifier for the new control and only then you would be able to add a new button on the form.
    Regards,
    Prashant

  • Matrix x System Form x UDO

    Hey all,
    I´m asking for some help to deal with the following:
    I want to show a new Matrix in a System Form.  The data is from a UDO (line data - detail).
    How should i do that ?  Can i use UDO methods ? Anyone can help me ?

    Hi Christiano,
    If you are modifying a System Form then you cannot use the UDO methods to save everything automatically. How you will add your matrix to the system form? Are you adding a new folder?
    If you want to use the UDO methods then you need to create a separate form linked to your UDO. In this case you can add a button to the system form opening your form.
    Hope it helps
    Trinidad.

  • 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
    Yoav

    Hi 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

  • Send Click Event to System Form

    Hi, i want to open a system form and open a specific entry.
    but how can i send the button the click event?
    what i was doing was:
    sDocEntry = oCompany.GetNewObjectKey();
    SBO_Application.ActivateMenuItem("1540");
    oForm = SBO_Application.Forms.ActiveForm;
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;
    ((SAPbouiCOM.EditText)oForm.Items.Item("141").Specific).Value = sDocEntry;
    ((SAPbouiCOM.Button)oForm.Items.Item("1").Specific) ????
    how can i do it??
    regards
    Philipp

    HI,
    sDocEntry = oCompany.GetNewObjectKey();
    SBO_Application.ActivateMenuItem("1540");
    oForm = SBO_Application.Forms.ActiveForm;
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;
    ((SAPbouiCOM.EditText)oForm.Items.Item("141").Specific).Value = sDocEntry;
    ((SAPbouiCOM.Button)oForm.Items.Item("1").click()
    Regards,
    J.
    Ps: vote and points.

  • Detect if fillable form is open in Acrobat (as opposed to Reader or web browser)

    I have a fillable form that is Reader Extended (so it can be saved from Adobe Reader). After a user fills in the form, he clicks a submit button that sends a data stream to a servlet. The servlet embeds this data as XML in another version of the form, converts the form to be PDF/A compliant, and returns the new PDF/A form with embedded data. That all works fine when the fillable form was open in either Reader or a web browser. But if the user has the fillable form open in Acrobat when he clicks the submit button, the embedded data is stripped out of the PDF/A form that's returned by the servlet.
    It's not a problem if the user fills in the data while the form is open in Acrobat, as long as he closes the form and opens it in Reader or a web browser before clicking the submit button.
    Is there a way to detect if the fillable form is open in Acrobat (perhaps in the preSubmit event?) so I can display a message warning the user to save and close the form, and then open it in Reader or a web browser before clicking the submit button?

    I added the following code to my submit button, but it gives me the same appType and host.name values for IE and Acrobat, so I can't tell them apart:
    var  
    viewerType = xfa.host.appType;
    var  
    viewerName = xfa.host.name;xfa.host.messageBox("Viewer is "
    + viewerType);xfa.host.messageBox("Host is "
    + viewerName);
    viewerType is Exchange-Pro
    viewerName is Acrobat

  • Simple problem with popup message before adding document on system form

    Hi all,
    We have an AddOn that validates price lines on system Sales Order form matrix, so that if prices fall below a certain value, a popup is show to ask to continue or not, when user presses ADD button.
    The problem is that if he chooses yes (to continue), the Sales Order is not added since the button ADD keeps being selected ....
    Here is my code:
            [B1Listener(BoEventTypes.et_CLICK, true)]
            public virtual bool OnBeforeClick(ItemEvent pVal)
                int iResult = B1Connections.theAppl.MessageBox("Price lines fall bellow minimum! Continue?", 1, "NO", "YES", "");
                if (iResult == 1) // NO
                    // Show error
                    B1Connections.theAppl.StatusBar.SetText("OK", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                // YES: Continue to add Sales Order
                return true;
    The problem is somehow related with the popup message being shown: if user says YES to continue, the system form does not continue with the standard process of adding the Sales Order (when I move the cursor above the ADD button is shows it already pressed...).
    Do I have to do anything more to force the process to continue, when the user says YES?
    Regards,
    Manuel Dias

    Thtas known problem. The solution for this is declare global variable as boolean, when user selects Yes, then set this variable to true and emulate click to add button again where before the message box check if its varaible sets to true - in this case dont show message box, only set variable to false.
    The concept of code will be
    dim continue as boolean = false
    in item event
    if continue = false then
        x = messagebox...
      if x = 1 then
        continue = true
         items.item("1").click
    end if
    else
    continue = false
    end if

  • Item ID for Minimize, Maximize button at system form title bar

    Hi,
    Can anyone help me out finding Item ID for Minimize, Maximize and close buttons at system form title bar (Left side Title of form and right side three buttons). I need ID for these items, if anyone knows please reply. will appreciate help on same.
    Thanks,
    Jay

    I'm tryin to get over with Item master screen strech machenism. I've Added matrix at pane 6 and position is not fixed when ever form is rezised or base product font size is changed. I've alredy tried providing values to top left width height through oexisting item vaues, I'm not using any integer value. Let me know if i can freez it's position ....... Sample code below
    oExistingItem = oForm.Items.Item("174")
    oItem = oForm.Items.Add("mtx_MFGALS", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
    oItem.Top = oExistingItem.Top + oExistingItem.Height + oExistingItem.Height
    oItem.Width = oExistingItem.Width + oExistingItem.Width
    oItem.Height = oExistingItem.Width
    oItem.Left = oExistingItem.Left
    oItem.FromPane = "6"
    oItem.ToPane = "6"
    oMatrix = oItem.Specific
    oMatrix.Columns.Add("Col0", SAPbouiCOM.BoFormItemTypes.it_EDIT)
    oMatrix.Columns.Item("Col0").TitleObject.Caption = "Line #"
    oMatrix.Columns.Add("Col1", SAPbouiCOM.BoFormItemTypes.it_EDIT)
    oMatrix.Columns.Item("Col1").TitleObject.Caption = "Name"
    oMatrix.AutoResizeColumns()
    Regards,
    Jay

  • Adding filename in PDF form and inserting the filename as the subject when emailing the form

    I have created a form in LiveCycle and have added 2 buttons - Save As and Submit by Email (created successfully thanks to the posts in this Forum).  Can someone please advise how I can:
    1.  Add the file name to the PDF document when the Save As button is clicked.
    2.  Use the file name as the Subject when the user clicks the Submit by Email.
    Thank you in advance for your help with this query.

    Here is a sample for your save as request.
    http://thelivecycle.blogspot.com/2009/11/save-form-to-specific-directories-and.html
    To determine the file name and use it in the subject you can use for example:
    var FileName = event.target.documentFileName;
    event.target.mailDoc({
            bUI: false,
            cTo: [email protected],
            cSubject: FileName,
            cMsg: "Bla bla bla...",
            cSubmitAs: "PDF"

  • Adding a Button to a Form

    I am brand-new to Oracle Forms, but have experience in VB and PL/SQL. Anyway, I have created a sample form based of a simple view. It will run client-server and I can also run it (recompiled) via Forms Server on my Solaris-based 9iAS Apps Server.
    When I go to add a simple button to the form, I see 12 identical buttons stacked up and acting as 1 large button. Same thing for any inerface item. What is going on?
    Using Forms 6i by the way.

    Check the number of records displayed in the datablock that you're adding the button to. It's probably set to 12.

  • Update a system form with XML: empty screen when this is a target document.

    Hi,
    It is possible to update a system form with an xml file.
    In the UI_Application.LoadBatchActions(xmlDoc). In the xmldocuemnt I update a system form by adding controls on it. This all works fine, except one (big) problem.
    Assume that I Alter the 'Good Receipt PO'.
    This document can be the target document of a Purchase order document. When you open a PO and click the icon on the toolbar for going to the target document, you see the target document filled in, in OK (view) mode.
    When you alter the 'Goods Receipt PO' form with XML you get an empty goods receipt form, in Add mode.
    Is this a known problem, how can I solve it?
    Thanks in advance
    Eddy

    Hi Florian,
    The XML looks like:
    <?xml version="1.0" encoding="UTF-16"?>
    <Application>
       <forms>
          <action type="update">
             <form AutoManaged="1" BorderStyle="0" FormType="143" ObjectType="20" SupportedModes="15" appformnumber="143" client_height="424" client_width="570" color="0" default_button="1" height="458" left="207" mode="3" pane="1" title="Goederenontvangst (bestelling)" top="23" type="0" uid="F_233" visible="1" width="578">
                <items>
                   <action type="add">
                      <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="19" left="434" linkto="" right_just="0" supp_zeros="0" tab_order="830" text_style="0" to_pane="0" top="398" type="4" uid="100001" visible="1" width="85">
                         <AutoManagedAttribute>
                            <Attribute description="editable" id="2" modeAdd="1"/>
                         </AutoManagedAttribute>
                         <specific caption="Container"/>
                      </item>
                   </action>
                   <action type="update">
                      <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="19" left="315" linkto="2" right_just="0" supp_zeros="0" tab_order="1160" text_style="0" to_pane="0" top="398" type="4" uid="68" visible="1" width="114">
                         <AutoManagedAttribute>
                            <Attribute description="editable" id="2" modeAdd="1"/>
                         </AutoManagedAttribute>
                         <specific caption="Voorfactuur"/>
                      </item>
                   </action>
                </items>
             </form>
          </action>
       </forms>
    </Application>
    Thank you very much for trying this.
    Eddy

Maybe you are looking for

  • Depr calculation- period control

    Hello, I have an issue with depreciation calculation. For two depr area 01,15 I choose the same depr. key(with reducing balance method) For these areas have next depr value: Area    Period  Value 01   1  100 01   2   90 01  3  80 02  1 100 02  2 100

  • Not able to reinstall OSX Snow Leopard - broken hard drive?

    Hi! So I have the following problem, that I would like to have some help with. Until recently my iMac (early 2008, 3.06 GHz Core 2 Duo, 2 gb ram, 24") has been running with OSX and Windows 7 in bootcamp. All of the sudden, I was not able to boot OSX;

  • Insert date and time

    This is a simple question but one that has been bugging me in a small way. If on a spreadsheet I press 'insert date and time' all I get is that day and date for example saturday 10th July 2010 and no time. Anyone offer an explanation for this? Thanks

  • Fat32 cf card - can't delete folders/files

    I have a fat32 formatted compact flash card I am using in my vehicle for mp3 playback. When I delete folders off of this through Finder, Finder shows as if they were deleted, but when you read the card on a Windows machine, or in my vehicle, the fold

  • How to: Make a border around a text

    In word or OpenOffice, when i have a line of text I can click on an icon to select it's border... but I don't seem to be able to find how to do that in Pages. Is it possible?