Validation in Form Data add Event

Dear All,
I am developing an add-on m facing some problems in the Form_Data_ADD Event. I have created a form using screen painter and i have done some validations for few fields those fields are mandatory. after entering some data iam closing the form it will show a messageBox saying do you want to save the changes or not n if i give yes its saving data. but it has to show the error message saying certain fields are mandatory.please suggest some solution regarding how to validation in such a condition.
Regards,
Anand.

Hi Anand,
I do my validations either in the Form Data Add event, when BusinessObjectInfo.BeforeAction = True or in the ItemPressed Item Event, when pVal.BeforeAction = True. In both cases, if I need to stop b1 from adding the record, I set BubbleEvent to False.
I guess that in your case it's not working because you're catching the BusinessObjectInfo.BeforeAction = false or because you're not setting BubbleEvent to False.
Regards,
Vítor Vieira

Similar Messages

  • DATA ADD EVENT

    Hi Experts,
        I have checked one condition in FORM DATA ADD EVENT and also I have stop the action using BUBBLE EVENT = False. But its stopping whole add-on. When ever my condition is false , am getting error and its stopping the whole add on.
    Any idea for this error ??
    Regards
    Smith.

    Hi Tomy,
    If you want to do validation or checking before adding data,
    Why dont you do it on Item Event, on Add button, event = click,  and before action = true,
    if condition false then bubble event = false, exit sub
    else , go tru..
    nd.Q

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>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.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • Form field validation: All required data lost when clicking browser-back-button!

    Hi folks,
    I have a big problem using the validation text  field components of Spry when the user must click the browser back button (or clicking a history.back()-Link) because he has  entered a wrong CAPTCHA-code!
    Right now, all the data - only in the required fields - not in the optional  fields!!! - is lost and the user has to enter all data once  again;-(
    Does anybody know why only the data in the  required fields is lost? Is there a nice workaround?
    I really  appreciate a quick answer:-)
    Kind regards from cloudy Germany
    Thomas

    rememberFormInputs('frmlogin', 'input-');
    'frmlogin' should be the id of page, not the name. so on your <form> tag, add the id="frmlogin"
    remove the
    // overload alert
    function alert(str) {
         var el = document.getElementById('alert');
         if (el) {
              el.value += str+"\r\n";
    Its really bad practice to overwrite the alert. and inside the rememberFormInputs remove these lines:
    alert('old value remembered: '+old_value);
    alert('setCookie: '+name + ' = '+value);
    and it should work

  • How to suppress "no valid rows of data" warning for composite Planning Form

    I had an issue with using a 2-grid composite webform. I want to show Substitution Variables along with my primary grid. My secondary grid was created using Substitution Variables for rows, columns, and page dimensions. I am hiding all of the segments but not suppressing missing for rows or columns.
    The problem is that I get the message "There are no valid rows of data for this data form" on the composite form due to my secondary grid (the Substitution Variable grid). Any tricks on how to suppress that? I even tried to add some data to an intersection, but, even with data, hiding the segments seems to bring on the warning message.
    Thanks.

    That can be caused if suppress on columns is on. We usually ignore the column part
    Even after all suppression is turned off and still getting the error, then yes it is could be because there is not data for that intersection.
    Regards
    Celvin

  • HT201401 I can't add a contact or edit contacts the little + sign is no longer on my phone...same thing on my iCalendar.  I can no longer add events or dates.  how do I fix this?

    I can't add a contact or edit contacts the little + sign is no longer on my phone...same thing on my iCalendar.  I can no longer add events or dates.  how do I fix this?

    Reset your phone, hold the home and off button down until the apple symbol comes up. If that doesnt fix it then you need to restore your phone in itunes, Connect to itunes, right click on your phones name to the left, then click restore from backup. That providing you have backed up your phone recently.

  • Validation on a data form

    I need run a validation on a data form. Basically if the difference between budget and actuals (both of which are on a separate form, but combined on a composite) exceeds 5% I want to highlight the cell in red, or bold the text or something. Can someone point me in the right direction for this?

    Depends what version you are on, if it is before 11.1.2 then you would need to write some custom Javascript, 11.1.2 should let you write validation rules to change cell colors.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Compiling form data: how to add FDF data?

    Hi there
    I've created a PDF form and am testing the distribution and compilation process. I created the form in Acrobat. I suspect most of the end users will have Reader, so after having distributed it through the Acrobat wizard (to myself) I filled it in with Reader and sent it back (the FDF file).
    When I open this FDF file from my email application, it doesn't automatically add it to the data set created in the distribution process. Instead it says that the data file cannot be located and asks if I'd like to browse for it. I do so, find it, and the completed form opens in Reader, not Acrobat. I can get around this by ctrl-clicking in Mail and telling it to open with Acrobat.
    However, when I do manage to get the completed form open in Acrobat it does not add the data to the spreadsheet field at the top. If I try to Import Data, the FDF file is greyed out – it wants a PDF. And if I import the FDF by going to Forms > Manage form data > Import data..., it shows the completed form but not the data in the spreadsheet again.
    So, how can I add this FDF data to the data set and get it to display in the spreadsheet area? Alternatively, how can I save this completed form as a PDF (not a data set as happens if I go File > Save) so that I can import that into the data set?
    I hope I've explained it clearly enough! Any help would be appreciated.

    Priya,
    Preview the iview and try shiftright click or ctrlright click and add the additional fields.
    if it doesnot work then you need to customise the code as per the requirements.

  • In Service contract, to change the valid form date on service code level.

    Hi.
    I want to change the price valid form date on service code level ( i.e. in condition)  in Service contract.
    I know i can  do that with ME32 transaction but i have lot of Service contract with more then 10,000 line items
    Is there any way that i can change in mass based on Service contract no. wise.???
    Thanks in advance..
    Edited by: VIKRANT HANDE on Sep 15, 2009 9:11 AM

    Please check in KON* series table in SE16N transaction. I guess KOHN table may help you out. You can see other similar tables.
    In any one of the table you will find validity data.

  • How to perform validity checks just before form data is saved?

    hello all,
    i need to perform some checks on various fields just before data on a standard form is saved, and to eventually rollback the transaction.
    if the checks are succesful i have to perform some db operation in transaction with main data.
    solution ( if existent! )  has to be addin only -> no triggers / no procedures / no sbo_transaction thingies
    scenario:
    involved tables:
    OITM
    USERDEFINEDTABLE1
    USERDEFINEDTABLE2
    involved forms:
    Items - OITM - formtypeex = "150"
    logic:
    an user defined field U_UDFCHECKACTIVE has been added to OITM, a combo box has been added to items form containing values Y and N, bound to OITM.U_UDFCHECKACTIVE.
    when the user saves an item, if OITM.U_UDFCHECKACTIVE == Y we have to perform additional checks on USERDEFINEDTABLE1
    if the check result is true we have to save OITM current data and insert a record in USERDEFINEDTABLE2 containing itmgrp value (  )
    if the check result is false we have to block save operation
    if OITM.U_UDFCHECKACTIVE == N no check is performed and everything works normally
    we started hooking the form data event for oitm / form type 150:
    Application.SBO_Application.FormDataEvent += new SAPbouiCOM._IApplicationEvents_FormDataEventEventHandler(FormDataEventHandler.SBO_Application_FormDataEvent);
    then we filtered the event
    switch (BusinessObjectInfo.FormTypeEx)
                        case "150":
                            if (BusinessObjectInfo.BeforeAction &&
                                (BusinessObjectInfo.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE ||
                                    BusinessObjectInfo.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD))
                                BL.Items_BusinessLogic.SBO_Application_FormDataEvent(ref BusinessObjectInfo, out BubbleEvent);
    in our business logic class i don't know how to correctly check the values just before they are saved to db
    for example i tried using oitm.browser :
    if (oitm.Browser.GetByKeys(BusinessObjectInfo.ObjectKey))
                            String value =  oitm.UserFields.Fields.Item("U_UDFCHECKACTIVE ").Value as String;
                             //perform checks
                                  //if ok insert records and bubbleevent = true
                                  //if ko rollback the bubbleevent = false
    //if checks are not to be performed then bubbleevent = true....
    but it's wrong, as it populates oitm object from db, and not from the form. i have old values stored in the object, values tha are to be overwritten with those present on form.
    i tried inspecting the form for data sources but i don't know how to navigate to the right one, i found only system generated objects with SYS_##, with no clue about the related dbfield
    i tried getting the values directly from the form, but in object BusinessObjectInfo i don't have anything that identifies univocally the form i'm editing.
    i mean if i have 2 item forms open, i don't know which one is the one i'm saving.
    i'm expecting to find somewhere a temporary oitm business object containing values that are to be saved, values that i can easily check.
    so i'm asking you how to find those values in order to perform my bl checks
    thank you in advance

    Hi Christian,
    The values that are about to be saved should be in the datasources:
    form.DataSources.DBDataSources.Item("OITM");
    form.DataSources.DBDataSources.Item("ITM1");
    The form variable should be form 150.
    Best regards,
    Pedro Magueija

  • Form Data Validations

    Imagine there is a field called "Username" ,"Password" and "Submit button".
    I want to implement following validations on click of "Submit" button.
    1 . Please enter Username.
    2.  Username should have a length of 10 characters.
    3.  Please enter Password.
    I want the validation procedure in 2 ways.
    1. The process of validation by indvidual criteria
    Example:
    displaying each validation message by validating all bussiness criteria one by one.
    That is in the above "Username" will be validated first.
    If user enters value it will check for number of characters less then 10.
    If this is passed then need to check for password entry.
    2.  Validating complete form at once
    Validating complete form for all bussiness conditions and displaying them at once.
    Please provide any links for data validations.

    Hey Raghu,
    you can implement a method like checkFields() in the "@@begin others" part of your view which returns a boolean value. When you press the "SUBMIT"-button it is checked whether every mandatory field is filled with the correct data. There you can implement the logic of your query.
    Here is an example for the method <b>checkFields()</b>:
    /** Checks whether the mandatory input fields are filled with regular data. */     
      private boolean checkFields()
         if ( wdContext.currentFreightrequestElement().getTitleInputField() == null ||
                   wdContext.currentFreightrequestElement().getTitleInputField().trim().length() == 0 )
              wdComponentAPI.getMessageManager().
                   reportContextAttributeMessage(wdContext.currentFreightrequestElement(),
                   wdContext.nodeFreightrequest().getNodeInfo().getAttribute(ATTRIBUTE_TITLE_INPUT_FIELD),
                   IMessageFreightRequestComponent.ERROR__01,
                   null,
                   false);
              return false;
    The important thing is the <b>reportContextAttributeMessage()</b> which highlightens a field you want to check.
    In the action-part you can use parts of the following code:
    boolean success = false;
         if ( checkFields()) {
              success = wdThis.wdGetRequestComponentController().executeSave();
         if (success == true)
              IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
              String dialogText = wdComponentAPI.getTextAccessor().getText("TEXT_03");
              IWDConfirmationDialog dialog =
                   wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText, controllerInfo.findInEventHandlers("createNewRequest"),wdComponentAPI.getTextAccessor().getText("TEXT_04"));
              dialog.addChoice(controllerInfo.findInEventHandlers("returnToWelcomeView"), wdComponentAPI.getTextAccessor().getText("TEXT_05"));          
              dialog.setTitle(wdComponentAPI.getTextAccessor().getText("TEXT_02"));
              dialog.show();          
    So far,
    Domingo

  • How can i update system form udf based on udt add event

    hello experts,
    i require small functionality on customized form add event,one of the system form udf value at row level should be update for particular row on based on the values on the customized form.
    so it should go like this on add event of customized form system form's row level udf should be update
    Regards,
    Bhavank

    Hi
    Are you opening your customised form with reference to any system form or it works alone?
    If it works alone then on the add event of customized form you haveto use update query with reference to the system form
    Regards

  • Is their way to prevent a form data from being lost when a validation fails

    Is their way to prevent a form data from being lost when a validation fails?

    So I would use APEX_COLLECTION (there is some information in APEX documentation).
    Read all data you need to keep after submit and save them to your collection. Then, if validation fails, show report with data not from base, but from your collection. You have to create process, which creates collection, and you need to modify your report definition to get data not only from DB but also from collection.
    If you have any questions feel free to ask.
    Regards,
    Przemek
    Edited by: Przemek on 2009-01-10 17:47

  • How to add event in Date type bean

    Hi,
    I have created two date items - start date and end date.
    now I want to add event in these items?
    how can I add event in date type bean?
    Pls help..
    Thanks
    Amit

    Hi Swati,
    Yes, I have two OAMessageTextInput bean of Type Date.
    How can I set event by --StartDateBean.setEnterClientAction(ClientAction);
    I am unable to pass parameter of type "ClientAction" in .setEnterClientAction.
    how can I do this. If I declare by
    ClientAction DateEvent = null;
    then
    StartDateBean.setEnterClientAction(DateEvent);
    then it doesn't gives me any error but I am unable to initialize the value in "ClientAction" except null.
    How can I do this?
    Pls Help?
    Thanks
    Amit

  • DAC Form: Using rowsetPopulated event (NullPointerException raised!!)

    Hi,
    I am using rowsetPopulated event to display the total
    of my column field.I have a textfield for this purpose
    All goes well as far as showing the total is concerned
    in the textField.
    But, when I click the total textfield (although I donot require to do this!!) I get a NullPointerException.
    This is the output in the console :
    java.lang.NullPointerException
    oracle.dacf.dataset.InfoObject oracle.dacf.dataset.ValidationManager._findProducer(java.lang.String)
    oracle.dacf.dataset.InfoObject oracle.dacf.dataset.ValidationManager.getInfoObject(java.lang.String)
    void oracle.dacf.control.NavigationManager.displayLOV(java.lang.String)
    boolean oracle.dacf.control.NavigationManager._changeFocus(java.lang.String, java.lang.String, boolean)
    boolean oracle.dacf.control.NavigationManager.validateFocusChange(oracle.dacf.control.Control)
    void oracle.dacf.control.swing.TextFieldControl.focusGained(java.awt.event.FocusEvent)
    void java.awt.AWTEventMulticaster.focusGained(java.awt.event.FocusEvent)
    void java.awt.Component.processFocusEvent(java.awt.event.FocusEvent)
    void javax.swing.JComponent.processFocusEvent(java.awt.event.FocusEvent)
    void java.awt.Component.processEvent(java.awt.AWTEvent)
    void java.awt.Container.processEvent(java.awt.AWTEvent)
    void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    boolean java.awt.LightweightDispatcher.setFocusRequest(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Component.requestFocus()
    void javax.swing.JComponent.requestFocus()
    void javax.swing.text.DefaultCaret.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
    void java.awt.Component.processEvent(java.awt.AWTEvent)
    void java.awt.Container.processEvent(java.awt.AWTEvent)
    void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
    boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
    boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
    boolean java.awt.EventDispatchThread.pumpOneEvent()
    void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
    void java.awt.EventDispatchThread.run()
    How do I go about it?
    TIA
    Sandeep
    null

    As many of the recent posts on this forum indicate, we have done extensive work on improving the documentation for JDeveloper 3.2. Here is an excerpt from one of the sections which describes Validation and Change events. I'll post a description of the Navigation events in another message due to size limitations.
    About InfoProducer Change Events
    Calculated fields display values that depend on the values of other fields. For instance, the value of a Total field may be calculated at the level of the row or the rowset. The AttributeInfo or RowSetInfo components provide a set of events that you can use to assess when column data has changed and perform updates of calculated fields on the Java client. When one of these events fires, the application can perform an automatic calculation to update the contents of the calculated field.
    The following table provides a high-level description of these InfoProducer-change events:
    Event Type
    Triggering Action
    attributeChanged
    Occurs when an attribute's value is changed.
    rowAdded
    Occurs when a row is added to a rowset.
    rowUpdated
    Occurs when a row is updated in a rowset.
    rowToBeRemoved
    Occurs when a row is about to be removed from a rowset. This event fires when a user presses the Delete key, but before the row is actually deleted from the rowset.
    rowsetCleared
    Occurs when all rows are deleted and the rowset is cleared.
    rowsetPopulated
    Occurs when the rowset is populated, for example, when a user navigates to the next item in the master table or when a new query is executed (for example, by submitting a parameterized query using the Find Panel).
    In summary, data form events let you update a calculated field when a user:
    Updates a field value
    Adds and removes rows
    Displays a new detail
    About InfoProducer Validation Events
    In those situations where you need to perform validation in the data form, the InfoProducer components provide a rich set of UI-validation events that you can exploit. For example, you might use an InfoProducer-validation event:
    To enable the Commission field when a user adds a new employee to either the Sales or Consulting department.
    To automatically calculate a new running total whenever the quantity or price of a line item is changed on an order entry form.
    You can define InfoProducer-validation events for:
    SessionInfo data item objects, which can receive the following events:
    validateRowSet
    validateRow
    validateAttribute
    RowSetInfo data item objects, which can receive the following events:
    validateRowSet
    validateRow
    validateAttribute
    AttributeInfo data item objects, which can receive the following event:
    validateAttribute
    The following table highlights the differences between these various InfoProducer-validation levels:
    Event Type
    Triggering Action
    Use when you want to:
    validateRowSet
    Occurs when focus changes from one modified RowSet to another RowSet in the same session.
    Note: Currently there is no session-level event support.
    Perform a calculation over all the rows in a RowSet
    For example, when the sum of the order items cannot exceed a prescribed customer order limit.
    Perform a validation across multiple rows
    For example, to verify that only one person is the head of a department.
    validateRow
    Occurs when focus changes from one row to another row in the same RowSet.
    Perform a validation across multiple columns
    For example, when the sum of the salary plus commission plus a sign-on bonus cannot exceed a maximum, and you want to defer validation until the user has finished entering or updating all fields.
    validateAttribute
    Occurs when focus changes from one modified Attribute (column) to another Attribute in the same Row.
    Ensure the validity of data at an atomic level
    For example, to check the state of an order states: pending, backordered, or awaiting_confirmation.
    Provide feedback to the user as quickly as possible
    For example, when a credit card number is invalid.
    How Data Forms Propogate InfoProducer Validation Events
    When a user's data form interaction generates a validation, the data form typically propagates the event to more than one bound InfoProducer object. For example, the simple action of selecting a field in a new row of a InfoSwing grid will trigger these events:
    validateAttribute on the bound AttributeInfo object
    validateAttribute on the bound RowSetInfo object
    validateAttribute on the bound SessionInfo object
    validateRow on the bound RowSetInfo object
    validateRow on the bound SessionInfo object
    validateRowSet on the bound RowSetInfo object
    validateRowSet on the bound SessionInfo object
    Because user interactions can trigger events across multiple bound InfoProducer objects, data forms follow an event hierarchy that determines the sequence by which the system seeks to handle the event. InfoProducer events propagate up a tree structure that is based on the heirarchy of attributes, rows, and rowsets.
    The hierarchy of InfoProducer events is represented by this tree:
    RS1
    R1 R2
    A1 A2 A3 A4
    where the attribute events fire first (at the bottom of the tree), followed by the row events, and finally the rowset events.
    When the user generates a validation event for a bound InfoProducer object, the data form generates the corresponding events depending on where in the tree the action takes place. For example:
    Moving between two rows in the same rowset (from R1 to R2), would generate these validation events (assuming the user moved the focus from the field for A1):
    validateAttribute event delivered at A1, R1, RS1
    validateRow event delivered at R1, RS1, and the session
    validateRowSet event delivered at RS1 and the session
    Moving between two attributes in the same row (from A1 to A2), would generate these validation events:
    validateAttribute event delivered at A1, R1, RS1, and the session
    The following table describes the complete sequence in which InfoProducer validation events are first fired and then delivered to listeners:
    Events are fired in this order:
    Events are delivered in this order:
    1. attribute events
    At the attribute level
    At the row level
    At the rowset level
    At the session level
    2. row events
    At the row level
    At the rowset level
    At the session level
    3. rowset events
    At the rowset level
    At the session level
    Handling InfoProducer Events at the Desired Level
    The InfoProducer object you choose to handle the attribute, row, or rowset event, will be based on:
    The nature of the event
    The response required by the event
    For instance, to write more efficient code, you may choose not to handle attribute events at the level of the AttributeInfo object. Instead, you could write a single event handler for the RowSetInfo object to perform validation for all the fields.
    Thus, the further up the hierarchy you position your event handler, the more generic the response will be.
    null

Maybe you are looking for

  • Adobe Encore and Creative Cloud Help...

    Hello, I am using  Creative Cloud. I tried to access the Encore program but it was not there. I went to Adobe training and was instructed to UNinstgall the Premiere CS6 trial I had been suing but to leave the Encore intact. I did this but it still wo

  • Mac OS Mavericks is crashing on my macbook Pro

    I have a Macbook Pro Processor: 2.66Ghz Intel Core i7 Memory: 8GB DDR3i recently upgraded to mavericks after that my laptop got very slow, also now it has started to crash a lot of times. while running the screen just becomes white and there is this

  • No sound through macbook since using apple tv

    Since using my apple tv, I cannot get sound through the macbook speakers at all. i think it is redirecting to the tv. i have tried turning the apple tv off and turning airplay off but this has not worked. any ideas?

  • CRT monitor to add on

    I have a flat scrn and now an additional CRT monitor to add on to my G5 to have a larger desktop to work with. Where do I start? How do I know if an ADC-VGA adaptor will work? And how do I set it up ? Thanks, Ed

  • Mail just shuts off when sending

    About 1 in 10 times that I try to send an e-mail, the e-mail application just shuts down, it goes away! What is the deal. I might spend 10 minutes typing an e-mail and then when I push send, the phone returns to the home screen. Man this is irritatin