Document Add button - change a UDF so B1 writes value to  tables

When the user presses the add button on a document, like an invoice, I want to loop through the items matrix and update a UDF on each row, so that Business one will write my values in the UDFs to the line item table (INV1), but I can't figure out how.
2 problems: The first is all the message boxes that B1 sometimes displays (like document total is zero, or error messages like 'no tax code entered'.  I need to do my work AFTER these all occur, but just BEFORE the document is created.  WHEN do I do this?
The other problem is that it seems like when I've tried something like this before, My changes to anything on the screen cause B1 to re-fire the events and then cancel the Add.
I don't want users to change these fields after I've loaded them, and I'd rather not retrieve the document after it's added and then change the values.  I've found similar problems in the forum but none of them speaks exactly to this
Any ideas?
Thanks/Gracias/Dankeschoen/Merci/Danyavad/Toa chie

Hi John,
Hope you're doing well.
I suggest the formdataevent.
There is a example in the sdk.
This is what I use:
Public Sub FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles UIAPP.FormDataEvent
            'Occurs when the application performs the following actions on forms connected to business objects:
            '            Add()
            '            Update()
            '            Delete()
            'Load form data via browse, link button, or find
            'The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object.
            'You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.
            Dim form As SAPbouiCOM.Form = UIAPP.Forms.Item(BusinessObjectInfo.FormUID)
            Dim bisObj As SAPbouiCOM.BusinessObject = form.BusinessObject
            Dim uid As String = bisObj.Key
            FormDataEventCommon.FormDataEventLogic(BusinessObjectInfo, BubbleEvent, bisObj, form)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(form)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(bisObj)
            form = Nothing
            bisObj = Nothing
            GC.Collect()
        End Sub
calls this function.
Public Function FormDataEventLogic(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean, ByRef bisobj As SAPbouiCOM.BusinessObject, ByRef form As SAPbouiCOM.Form) As Boolean
            Dim Test As Integer = form.Mode
            Dim mat As String = ""
            Dim Fld As String = ""
            Dim rep As String = ""
            Dim ColFlag As Boolean = False
            If BusinessObjectInfo.BeforeAction Then
                Select Case BusinessObjectInfo.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD
                        Select Case BusinessObjectInfo.Type
                            Case "COMMISSION OBJ UDO"
                                Dim CommTblClass As New CommAdj_Class(form.UniqueID)
                                Dim StrLN As String = CommTblClass.GetFieldValue(form.UniqueID, "EMONLN")
                                If StrLN = "" Then
                                    CommTblClass.Displayerror("Please enter a load number")
                                    BubbleEvent = False
                                End If
                                CommTblClass.release()
                        End Select
                End Select
            Else
                Select Case BusinessObjectInfo.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD
                        ' Addnew information for a new document
                        Select Case BusinessObjectInfo.Type
                            Case SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oOrders
                            Case SAPbobsCOM.BoObjectTypes.oInvoices
                            Case SAPbobsCOM.BoObjectTypes.oCreditNotes
                            Case SAPbobsCOM.BoObjectTypes.oReturns
                            Case SAPbobsCOM.BoObjectTypes.oQuotations
                            Case SAPbobsCOM.BoObjectTypes.oPurchaseInvoices
                            Case SAPbobsCOM.BoObjectTypes.oInventoryGenEntry
                            Case "COMMISSION OBJ UDO"
                        End Select
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE
                        ' Update exisitng Document
                        Select Case BusinessObjectInfo.Type
                            Case SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oInvoices
                            Case SAPbobsCOM.BoObjectTypes.oCreditNotes
                            Case SAPbobsCOM.BoObjectTypes.oReturns
                            Case SAPbobsCOM.BoObjectTypes.oOrders
                            Case SAPbobsCOM.BoObjectTypes.oQuotations
                            Case SAPbobsCOM.BoObjectTypes.oInventoryGenEntry
                            Case "COMMISSION OBJ UDO"
                        End Select
                    Case BoEventTypes.et_FORM_DATA_LOAD
                        Select Case BusinessObjectInfo.Type
                            Case SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes
                            Case SAPbobsCOM.BoObjectTypes.oInvoices
                            Case SAPbobsCOM.BoObjectTypes.oCreditNotes
                            Case SAPbobsCOM.BoObjectTypes.oReturns
                            Case SAPbobsCOM.BoObjectTypes.oOrders
                            Case SAPbobsCOM.BoObjectTypes.oQuotations
                        End Select
                End Select
            End If
            Return True
        End Function

Similar Messages

  • Add button - redirect to other Entity with predefined value

    Hi,
    I have entities User and Student. In User I have attribute Role. For both entities I have created screens. And when I click on button Add on screen BrowseStudent, I want to be redirected to AddEditUser with predefined value (Student) of attribute User.Role
    in form AddEditUser and disable modifying this value by user. Is it possible in Lightswitch? Redirect to other method was simple but predefined value is problem for me. Thank you for help.

    Hi,
    I have seen attempts to use javascript to add entire new rows, and I've even tried this myself, but I'm not sure we've nailed it yet! Have a look at Denes' example: [http://htmldb.oracle.com/pls/otn/f?p=31517:207]
    If this method is not possible/practical, then you would need to be able to pass at least the ID of the row to a process that can set, perhaps, application items that can be used as defaults. The process would need to retrieve the data from either the underlying tables or the tabular form's data collection (using APEX_APPLICATION.G_Fnn functionality). Otherwise, the user's selection would be lost during the submit/reload process.
    Andy

  • Documents.Add failing in PS CS5.1

    I wrote a program using VB Express 2008 that worked flawlessly until I updated to CS5.1.  I'm stuck as to what could be causing the failure.
    The failing call is:
    docRef = appRef.Documents.Add(PageW, PageH, 300, NewDocName, , 1)  'white
    PageW = 3001,
    PageH = 2475
    NewDocName = Y2013
    docRef is a global variable, and appRef is defineds as:
    appRef = CreateObject("Photoshop.Application") 
    What is real odd, is that I use the same call in another program.  I copied from this one to it, and the other program works fine.
    One other difference, CS3 was 32 bit.  CS5.1 is 64 bit program.
    Any help would be appreciated.
    Mike

    I made this work.  I replaced the variables in the documents.add call with constants that were identical to values in another program that was working.  The call worked.  So I tried walking back the changes until I got back to the original code.  Still works.  Shut everything down, brought it back up in the VB environment, still works.  Tried to run original compilation, failed.
    Apparently any VB for Photoshop that was compiled before I installed CS5.1, 64 bit, fails.  If I recompile it, it works fine.
    Another problem, if I start PS CS5.1 in 32 bit mode, or CS3, the scripts all fail, regardless of whether or not they were compiled before CS5.1 was installed. The error here states that it cannot start the ActiveX module for Photoshop.
    Does anybody know if VB compiled in Win 7 and CS5.1 64 bit will run on a 32 bit Photoshop installation?  If I distribute this program do I need a 32 bit and a 64 bit version?
    Mike

  • Displaying Screen After the Add Button is pressed and the document is saved

    Hi All,
    I am trying to the Display the Landed Cost screen after the Goods Receipt PO has been added and Saved.
    My code below: <b>If pVal.ItemUID = "1" And pVal.FormTypeEx = "143" And pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE And pVal.BeforeAction = False Then
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK Then
                    Dim oMenuItem As SAPbouiCOM.MenuItem
                    oMenuItem = SBO_Application.Menus.Item("2310") 'modules 2310 is the Landed cost screen'
                    oMenuItem.Activate()
                End If
            End If</b>
    It displays the landed cost screen when i Click the add button, But I need to display it after the the document has saved, ANy inputs on the same!
    Your help is appreciated!!!

    Hi Vinayak,
    Change the code
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK Then
    to
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
    And it will work.
    Best Regards,
    Nick He

  • I just installed itunes 11.1.5.5.  Now the format in Itunes is changed.  when I am trying to add music to my iphone, there is no longer an add button under the Iphone device.  Why did they have to change this?  Can anyone help, Im tryiong to add music.

    How do you add musci to the Iphone?  I just installed itunes 11.1.5.5.  Now the format in Itunes is changed.  when I am trying to add music to my iphone, there is no longer an add button under the Iphone device.  Why did they have to change this?  Can anyone help, Im tryiong to add music.

    Correct.  When you purchase devices, they would have stated the OS they needed to work, on the box.  This can be overlooked, but it is very important to check when purchasing. 
    You current OS, is so old, that they technology build into the new devices, is not something your OS understands.  It didn't exist when your OS was created, and therefore you need to upgrade the OS to work with the newer technology of these devices.
    10.6 software is not downloadable.  You must purchase a DVD disc.  You can order it from the on-line apple store
    - http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard.

  • Link Document Library Add Button to home page

    Let me know if it is possible to link the document library add button to homepage or any other page, if possible add a new icon to it, as part of customization.
    I am using sharepoint 2013.
    If possible please let me know the steps, as well as few articles related to the above would be helpful.
    Thanks

    As you are not displaying your new item form into a dialog you can remove the IsDlg=1 from your link and you can append a &Source="PageWhereYouWantToGoBackAfterUpload".
    <a href="/sites/Contracts/_layouts/15/Upload.aspx?List=%7b89225CDC-B61A-45FC-8DC3-AC7DD97578CA%7d&amp;RootFolder=&amp;Source=http://www.yourSite.com"> Upload a doc</a>
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Udf to add context change

    Hi
    I need a udf to add context change
    Can anyone help me?
    Regards
    Neha

    A search on help.sap.com is the answer.
    http://help.sap.com/saphelp_nw04/helpdata/en/b1/83a09f668320419dbe00a741e0fe6a/content.htm
    addContextChange();
    Appends a context change to the list. This can also be achieved if you append the constant ResultList.CC by using addValue().
    Regards
    Bhavesh

  • Set Rendered on a 'Add' button to False has caused HTTP 400 error

    Hi,
    I am trying to personalise in Manager SS a custom version of seeded 'Documents of Record' function HR_DOR_SS to make the Add Record button non-display on the Documents of Record table. I changed Rendered to False, got the 'Setting this item to false may hide this item and its children' message but went ahead and did it anyway.
    Outcome is that I can see the records in the table but can no longer view, update or delete existing records. I get a http 400 bad request page. I changed the 'Add' button back to Rendered True, but problem persists. Get the error also when I try to create a new record using the now re-instated button. Imported the personalization from another environment where it's working fine, bounced apache, clear cache etc and still problem persists.
    Also if no record exists for employee, Add button works fine and I can create a record but from that point on cannot do anything with it.
    Any help v much appreciated.
    Thx

    Yes, I've seen similar links/posts about how to activate buttons in the header of a table, but those do it by adding listeners to the renderer. My buttons would be directly in the CellRendererPane that is the container for the table header. I would have thought that by putting the button directly in the Cell RendererPane that it would have nothing to do with the rest of the table header. CellRendererPane extends Container. Is it not possible to put a JButton in a Container? JFrame extends indirectly from Container and you can add buttons to that.
    Edited by: Bob.B on Oct 28, 2009 10:57 PM

  • SOLAR02 The document cannot be changed

    Hello,
    I have developed a program that uploads files massively to Solution Manager, and the upload process works fine.
    But when i try to edit a document that i uploaded using this program, the systems shows me this popup message.
    The document cannot be changed.
    Because:
    it was copied from a template.
    it was copied from the Business Process
    Repository.
    it is saved in a different context.
    The document is flagged for copying, e.g.
    because you are in a copied project.
    <ZH>It has been copied.</>
    The reference to the original document is
    replaced by a reference to the copy.
    Has anybody seen this before or why is this message being showed.
    Kind regards
    Jon
    Edited by: Jon Azkorra on Dec 17, 2011 2:09 PM
    Edited by: Jon Azkorra on Dec 17, 2011 2:15 PM
    Edited by: Jon Azkorra on Dec 17, 2011 4:30 PM

    Hi Rajat,
    Sorry for the delay, I was out of office.
    If you really wish to switch off this protection you can use report SM_FOLDER_NO_REFCOPY. Please see note 1236369 for details
    In your case you would need to add the 'Technical Folder Name' SOLAR00 using the report Start report SM_FOLDER_NO_REFCOPY At 'Technical Folder Name' enter SOLAR00 and press the add button this inserts a new entry in table IWBSETTING. You should find in this table afterwards and entry with NAME = SM_FOLDER_NO_REFCOPY and VALUE = SOLAR00
    Afterwards when you try to change the documents (or their attributes) from within the implementaion project the document should not be copied anymore
    But please ba aware of the fact when using this that as of then the original document in the template can be changed from within every project type.
    bets regards,
    Fabrcius

  • In sales quotation document number not changed..

    hiii guys
    i getting some problem in sales quotation about document number.....
    actually i opened by another user like sham.he is sales department..he have only sales authorizations..when we press add button, data has been saved..but number not changed... but after saving,we close form and open again then that that time number automatically changed..its comes serial number..when we press add button,,we getting same problem...

    hi
    I think you got confused with document and draft no on Approval documents.
    Ofcourse many user,got this confusion.
    The Document number wont be generated in Sales Quotation till you add it(i.e when waiting for approval)
    The document number which is shown in  that document when pending for the approval, is not the finalised number.
    Its just the next number of sales quotaion which wont get stored in sales quotation,rather it will store in Draft table ODRF.
    when you have too many documents which is waiting for approval,you can notice that document number will be same for all the other documents.
    So you note down the Draft Number which is UNIQUE.
    For Ex:
    you are creating sales quotation which has the document number as '335'.
    so when you sending it for approval the draft number will be staored as '211'.
    after getting the approval,when you add it,document number will be generated as '337' because two documents were posted when the draft no:211 is waiting for approval.
    revert me for any clarification.
    Edited by: kambadasan on Feb 23, 2012 1:41 PM

  • Refresh document title on change

    Hi!
    Does anyone know how to refresh document title on change?
    I have master.jsf with
    <af:document title="#{someBean.activeDocumentTitle}" id="documentRoot">In method activeDocumentTitle I get currently active tab, and get its title. Then I build
    activeDocumentTitle by concatenating application name and currently active tab title. Like so:
    "ActiveTab/ApplicationName".
    Problem is the document title does not refresh on new tab opening. If I refresh it manually (F5), document title has right value. Please help.
    I use JDeveloper 11.1.2.1.0
    Regards, Marko

    When do you want to have partial trigger.it will not change the whole page.
    suppose u button click u want to refresh title.add the id of button in partial trigger of outputtext .change partialsubmit of button to true,
    http://www.techartifact.com/blogs/2009/03/partial-page-rendering-ppr-in-oracle-adf.html
    http://ranajitsahoo.blogspot.in/2008/04/enabling-partial-page-renderingppr-in.html

  • How to enable the add button in worksheet properties in OLAP

    Hi
    After Changing the time to Pacific, im able to manage the catalog..But still im not able to share any of my olap worksheets.
    I have also granted the BISM and D40 objects from ' user_objects table ' to the user from whom im trying to share the report..
    but in my OLAP report..the worksheet properties shows me the add priveleges button in a disabled form..pls can any body help me out..it is an urgent issue and cud'nt enable the add button..
    please give some guidance...
    Thank you,
    S. Kokila

    Hi,
    Normally, for the archiving or generation of the invoice document in PDF format is handled by maintaining the output records through VV31/VV32 with the relevant printer, storage mode ( 3- print and archive or 2- archive only ), no. of messages ( means no of copies ) in the communication method.
    Then when you click the print button through VF03 in the print options pop-up you get a print at the physical printer and at the same time an archived copy ( PDF copy ) attached with the document.
    So, please make sure the output records are fine to allow a PDF copy generated and then try to print and check in VF03 by entering into the billing document.
    Hope this helps you.
    However, from the print preview you normally would not be allowed to save or print.
    Regards,
    Ram
    Edited by: Ramakrishna Peri on Apr 3, 2009 9:16 AM

  • Add Button behaviour

    Hi,
    After completion of my coding, while debugging ,  my validations,data retrievals everything is working fine.But when I press the Add Button, lam getting the Message "You cant change the document after you have add it.."
    and data is not adding, there is no action takes place after clicking on Add Button,except this message..
    Please tell me how to rectify it...
    Thanks & Regards
    Chakrapani Bandaru

    Hi Mahendra,
    Iam placing my code here pls go thru this..in the item event
    If pVal.Before_Action = False Then
                Select Case pVal.FormUID
                    Case "DISTILLASION_"
                        Select Case pVal.EventType
                            Case SAPbouiCOM.BoEventTypes.et_CLICK
                                If pVal.ItemUID = "1" And pVal.FormMode = "3" Then
                                    oForm = SBO_Application.Forms.Item("DISTILLASION_")
                                    BubbleEvent = False
                                    oItem = oForm.Items.Item("Disp") '8
                                    If (oItem.Specific.value = "") Then
                                        oItem.Click()
                                        SBO_Application.MessageBox("- Please Enter 'Dispensing Document Number'")
                                        Return
                                    End If
                                    var1 = SBO_Application.MessageBox("You cannot change this document after you have added it. Continue?", 1, "Ok", "Cancel", "")
                                    If (var1 = 1) Then
                                     SBO_Application.MessageBox("Operation completed successfully"}
                                    End If
                                End If
                        End Select
                End Select
            End If

  • Add button to a maintenance view

    I am working with maintenance views and user-defined events in maintenance views at the moment.
    Now I'd like to add a button to the maintenance view that will show a popup with recent changes to the selected line of the database table.
    Is that possible with user-defined events or should I modify the generated dynpros manually. But then, will the modifications be deleted if I will have to regenerate the maintenance view in the future (e.g. when I might add a field to the database table)?

    If you are talking SE54 and Maintenance Views, when I do an SM30 on the Maintenance View and do SYSTEM->STATUS, I see GUI STATUS ZULG on program SAPLSVIM.  If you look at that status, I see two buttons with dynamic text.  The first one is call GPRF and has dynamic text VIM_PR_STAT_TXT_CH.  You can find a suitable PBO event to set the text of that function code and if that works, find a suitable PAI event to respond to that function.
    I recall finding some documentation on customizing the GUI STATUS but no luck today trying to find it.
    Let us know how it goes.

  • Add button to the transaction SM30

    HI
       Whether it is possible to add a buton to application tool bar in the transaction SM30.
    help reg this.

    Hi,
    Yes, it is possible to add button for the transaction SM30.
    This is possible through Menu exit.
    Procedure for Menuexit:-
    Go to SM30 ->System -> Status
    Repository data -> Transaction -> Double click on it
    Copy package name
    Go to SMOD
    Press F4 then a popup will open
    Click on information system
    Enter package name and press Enter
    Then we will get Exit
    Put cursor on that exit and press Enter
    Go to change mode and save it.
    Go to CMOD or alternatively we can use the path tools -> ABAP/4 Workbench -> Utilities -> Enhancements ->Project Management
    Specify Project name in the enhancement text box
    Click on Create icon on the application toolbar.
    Enter description for the project and save it
    Click on Enhancement Assignment button on the application toolbar
    Give Exit  and save it
    Go to Components on the application toolbar
    Double Click on MENUS001
    Write function text which we want to add to menu item and save it with an request      number
    Double Click on Exit and write code there to display menu item in the screen
    Activate the include program and finally activate the project.
    Please reward points if helpful.

Maybe you are looking for

  • Backing up to new external hard drive is not working

    I just purchased a new 2TB FreeAgent external hard drive. I hooked it up to use as a time machine backup and in the preferences of Time Machine it said that the drive needed to be formatted. I then went to Disk Utility and erased the drive using the

  • Exporting to PDF fails when report includes a barcode

    Post Author: Lorne Chisholm CA Forum: Exporting I am getting the following error when I try to export a Crystal Report file to a PDF format: CRAXDRT Error Occured on Server. -2147189152: Cannot find the QE property I am able to export the report to R

  • Images disappear when Flash application goes live

    My Flash 8 application works great when I test within Flash 8 and even when I test on the local browser. However, when I use it on the server it does not show the images. Could this be caused by my not referencing my image files correctly, how can I

  • You keep billing me and I am not receiving credits for my in app purchases

    apple need to contact me regarding this you keep billing me and I am not receiving my in app purchase credits now I cannot use my card on iTunes

  • [VF11] change due date when cancelling a document

    Hi everybody, I want to change due date (( FAEDT ) in FBL5N ) when cancelling invoices in VF11. I know that for that I need to change ZFBDT but I dont konw how . I need a user exit or a BTE or a Custo to make me change the due date. Thanks in Advance