Tabular form validation - save the correct values

I use the example of the Dene of validation in the form of table. It detects errors and displays the error messages, but I lose all the values that have been entered correctly. Do I need to use a collection to save? I was looking through older posts and comment, it's that you need only one collection if you want to show the user the values that they entered incorrectly. With the logic of the Dene, she tells them what line the error and what is the initial value was.
DECLARE
  l_error   VARCHAR2 (4000);
BEGIN
   FOR i IN 1 .. apex_application.g_f02.COUNT
   LOOP
      IF NOT TO_DATE (apex_application.g_f05 (i), 'YYYY')
            BETWEEN   TRUNC (TO_DATE (apex_application.g_f04 (i),'YYYY'))
                 AND  TO_DATE ('2008','YYYY')     THEN
                  l_error :=   l_error
                    || '</br>'
                    || 'Row '
                    || i
                    || ': Photo Inspection Year has to be greater than Date On Map and less than 2008 for '
                    || ' Map: '
                    || apex_application.g_f02 (i)
                    || '<br> Requested date: '
                    || apex_application.g_f05 (i);
      END IF;
      IF NOT TO_DATE (apex_application.g_f04 (i), 'YYYY')
            BETWEEN   TO_DATE ('1890','YYYY')
                 AND  TO_DATE ('2008','YYYY')     THEN
                  l_error :=   l_error
                    || '</br>'
                    || 'Row '
                    || i
                    || ': Date on map has to be between 1890 and 2008 for '
                    || ' Map: '
                    || apex_application.g_f02 (i)
                    || ' <br>Requested date: '
                    || apex_application.g_f04 (i);
      END IF;
   END LOOP;
   RETURN LTRIM (l_error, '</br>');
Thank you
Susan

This is a parameter in the validation - display message error location.

Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
-------------------------------------------------------------------

Tags: Database

Similar Questions

  • Save the selected value from the ListBox with its respective values control tab dropdown selected in another list box

    Hi all

    I'm doing a vi where I save the selected value from the ListBox with values respective tab control dropdown selected in another list box. Whenever I select Item1 can change of course and the respective tab will be open for this element. But now I want to just save the selection and put it into another ListBox.SO I can't renmove or add my wishes. Please help me.

    It will work.

    Probably not the greatest solution well.

  • Control the output is not the correct value

    Hello

    I have a producer consumer with a queue architecture to pass values. I want to push a new value in the table by using "Insert table" when a button is pressed, but when I do the previous value is read the first time and the correct value on the second press.

    I am self-taught and this is my first time using the queue so maybe something I'm not seeing/thinking about here?

    Version 8 attached VI.

    To see the problem, follow these steps:

    1. run
    2. click on "master reading.
    3. change the 'value '.
    4. click on "master reading.
    5. click on "master reading.

    Any help is appreciated especially block critical diagram.

    Thank you!

    It all depends on how you change the value of 'value. ' If you use the increment and decrement buttons it works as expected.

    If however, you type a new value and click the button without clicking elsewhere first, it does not - and here's why:

    When you type a modified value value does not appear in the code until the control loses "touch focus". The problem is that clicking the button causes the digital input to lose key focus, but only after the code responded to the mouse event.

    To solve the problem put a property node in the supported mouse event to set the property KeyFocus the digital to false until the value is queued.

    Mike...

  • Present do not get the correct values

    Apex 4.2

    THAT IS TO SAY 8

    Theme 21

    I just upgraded a request from 3.2 to 4.2

    A page has had a lot of text to read only the value always.

    A running a process I got this error

    So I put my items to display only and read to null

    When the page opens all values are set correctly in session state

    My process works well, but when the process terminates and then check out the session state, my articles do not receive the correct values

    I looked into debugging accept

    All ideas

    Gus

    I changed all my articles to text, but after sending, they continue to receive the false values

    Gus

  • How to make 'Save to Desktop' save the default value instead of 'This PC'?

    How to make 'Save to Desktop' save the default value instead of 'This PC'?

    Windows 10, I guess?

  • update to column values (false) in a copy of the same table with the correct values

    Database is 10gr 2 - had a situation last night where someone changed inadvertently values of column on a couple of hundred thousand records with an incorrect value first thing in the morning and never let me know later in the day. My undo retention was not large enough to create a copy of the table as it was 7 hours comes back with a "insert in table_2 select * from table_1 to timestamp...» "query, so I restored the backup previous nights to another machine and it picked up at 07:00 (just before the hour, he made the change), created a dblink since the production database and created a copy of the table of the restored database.

    My first thought was to simply update the table of production with the correct values of the correct copy, using something like this:


    Update mnt.workorders
    Set approvalstat = (select b.approvalstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)
    where exists (select *)
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)

    It wasn't the exact syntax, but you get the idea, I wanted to put the incorrect values in x columns in the tables of production with the correct values of the copy of the table of the restored backup. Anyway, it was (or seem to) works, but I look at the process through OEM it was estimated 100 + hours with full table scans, so I killed him. I found myself just inserting (copy) the lines added to the production since the table copy by doing a select statement of the production table where < col_with_datestamp > is > = 07:00, truncate the table of production, then re insert the rows from now to correct the copy.

    Do a post-mortem today, I replay the scenario on the copy that I restored, trying to figure out a cleaner, a quicker way to do it, if the need arise again. I went and randomly changed some values in a column number (called "comappstat") in a copy of the table of production, and then thought that I would try the following resets the values of the correct table:

    Update (select a.comappstat, b.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi - this is a PK column
    and a.comappstat! = b.comappstat)
    Set b.comappstat = a.comappstat

    Although I thought that the syntax is correct, I get an "ORA-00904: 'A'. '. ' COMAPPSTAT': invalid identifier ' to run this, I was trying to guess where the syntax was wrong here, then thought that perhaps having the subquery returns a single line would be cleaner and faster anyway, so I gave up on that and instead tried this:

    Update mnt.workorders_copy
    Set comappstat = (select distinct)
    a.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi
    and a.comappstat! = b.comappstat)
    where a.comappstat! = b.comappstat
    and a.workordersoi = b.workordersoi

    The subquery executed on its own returns a single value 9, which is the correct value of the column in the table of the prod, and I want to replace the incorrect a '12' (I've updated the copy to change the value of the column comappstat to 12 everywhere where it was 9) However when I run the query again I get this error :

    ERROR on line 8:
    ORA-00904: "B". "" WORKORDERSOI ": invalid identifier

    First of all, I don't see why the update statement does not work (it's probably obvious, but I'm not)

    Secondly, it is the best approach for updating a column (or columns) that are incorrect, with the columns in the same table which are correct, or is there a better way?

    I would sooner update the table rather than delete or truncate then re insert, as it was a trigger for insert/update I had to disable it on the notice re and truncate the table unusable a demand so I was re insert.

    Thank you

    Hello

    First of all, after post 79, you need to know how to format your code.

    Your last request reads as follows:

    UPDATE
      mnt.workorders_copy
    SET
      comappstat =
      (
        SELECT DISTINCT
          a.comappstat
        FROM
          mnt.workorders a
        , mnt.workorders_copy b
        WHERE
          a.workordersoi    = b.workordersoi
          AND a.comappstat != b.comappstat
      )
    WHERE
      a.comappstat      != b.comappstat
      AND a.workordersoi = b.workordersoi
    

    This will not work for several reasons:
    The sub query allows you to define a and b and outside the breakets you can't refer to a or b.
    There is no link between the mnt.workorders_copy and the the update and the request of void.

    If you do this you should have something like this:

    UPDATE
      mnt.workorders     A      -- THIS IS THE TABLE YOU WANT TO UPDATE
    SET
      A.comappstat =
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B   -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    WHERE
      EXISTS
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    

    Speed is not so good that you run the query to sub for each row in mnt.workorders
    Note it is condition in where. You need other wise, you will update the unchanged to null values.

    I wouold do it like this:

    UPDATE
      (
        SELECT
          A.workordersoi
          ,A.comappstat
          ,B.comappstat           comappstat_OLD
    
        FROM
          mnt.workorders        A      -- THIS IS THE TABLE YOU WANT TO UPDATE
          ,mnt.workorders_copy  B      -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
    
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      ) C
    
    SET
      C.comappstat = comappstat_OLD
    ;
    

    This way you can test the subquery first and know exectly what will be updated.
    This was not a sub query that is executed for each line preformance should be better.

    Kind regards

    Peter

  • APEX tabular form validation

    Hello

    I added a tabular presentation on my shape of the APEX. It has two columns, year and budget (to be seized of the user).

    In addition, the total budget is spent in the URL and stored in a variable in the form of the APEX.

    Now the required validation is the sum of the contribution of the individual budgets of the user for each year must be less than or equal to the budget total (stored in the variable in the form of the APEX.

    If this is not the case, an error message should be displayed.

    I am new to the development of the APEX and need help on that.

    Hi David,

    Just right click on the field and click on inspect element, you will get the details of the field.

    If your issue is resolved, then close this thread by ticking the correct answer on the post that solved the problem.

    That helps other users in the forum to solve their problem, if they have a similar question.

    Kind regards

    Jitendra

  • Tabular form validation

    Apex 4.2

    Problems with the validation of the form in a table and not sure what type of validation to use:

    My tabular presentation is based on a table SURVEY_JOB_TASKS:

    Survey_Job_Task_ID PK

    Percentage

    Task_Id FK

    Bundle_Id FK

    I also have a TASK table that contains all the tasks

    Task_Id

    TaskName

    In the validation form, the Survey_Job_task_Id is managed by a trigger. The percentage is an entrable field. The Task_Id is a selection list. The Bundle_Id is passed to the page; It is hidden.

    The Task_Id / select list is created with the following query

    Select task_name, task_id
    From TASKS
    
    

    I want a validation so that a user cannot enter the same task_id. If the selection list should look like:

    TaskName Task_Id

    Apples 1

    2 oranges

    Bananas 3

    Pears 4

    If a user accesses the page, enters an information line and select bananas in the selection list. The user saves / submits and leaves the page. The user returns to the page and they seek to enter another line, if they choose bananas once again, then validation strikes by saying that they cannot enter a double task identifier. There is an already established constriant in place which does not allow to do so. It gives an error ORA, but I wanted to make the error message a bit more friendly user.

    I tried some queries of variation of validation with type Exists or not exists but I may be missing it completely.

    Any help on this would be greatly appreciated. Thanks in advance

    plus extra extra extra... the logic should be a little different because otherwise it will always return false

    IF (( APEX_APPLICATION.G_F03(I) = APEX_APPLICATION.G_F03(j)) AND I<>J ) THEN
      RETURN false;
     end if;
    
  • LOV custom: Validation of the input value

    Hello, I am new in the OPS. Recently I tried to create a custom lov (column in a table), in an existing standard page.

    I need to validate the value inserted by the user.

    Validation, when I press the standard record button, works very well, but only for the last line clicked from the table.

    I need the validation of the row of the table.

    I'll elencate my approach to create. What Miss me to do?

    Tree of customization:

    columnHeaderID (column)

    -> myLovID (Lov input Message)

    -->--> the mappings of Lov

    ->->-> xxmap1ID (LovMap)

    ->->-> xxmaphelpID (LovMap) (*)

    -> myFormValueID (Form, Value) (*)

    -> column heading

    -->--> sortable header: nome colonna

    The question, I added, to allow the standard validation (in green):

    part of criteria (*) = myLovID

    box item attribute of the value returned by lov lov = name

    article = myFormValueID return

    use for validation = Y

    (*) view attribute = attribute of vo in the page, because I need to insert the value

    view instance = vo in the page, because I need to insert the value

    Thank you

    J


    I'll answer by myself: for the validation of all rows with the lov, I had to add a new attribute to vo in the controller of the main page and then set the mode of myFormValueID to this created attribute attribute.

    So I got the full validation.

  • line tabular form selector ignores the Tab key, how?

    Hello world

    We have Oracle 11.2 and Apex 4.2.6.

    Tabular form a selector of line, trying to prevent cleat key home, for item in normal form, I would use just something like tabindex =-1, but I don't know how I can add this tab index for the line selector, whose property is 'Download' BLOB. If I inspect element, it is a checkbox:

    < input type = "checkbox" name = "f01" value = "1" class = 'row selector' id = 'f01_0001' entered AutoComplete = "off" >

    How can I add tabindex = "-1" inside this entry line selector type?

    Any suggestions are greatly appreciated.

    $(':checkbox').attr ("tabindex", - 1).

    However, it would be preferable to add a static region id to your region and your prefix selector

    $('#p1_my_region_:checkbox').attr ("tabindex", - 1).

  • Unable to save the session value in the input field for db

    Hi all, I use oracle jdeveloper 11g release2. I'm not able to store session in the DB value. Actually I access to the session value (either x here) while the user logs and filling in the form of entrance to box as "#{sessionScope.x}". It works very well. But when I try to back up the folder DB his throw error saying required attribute 'viewname.x'. The value of x is present in the input area. Yet, its throwing the error. Any idea on this. Am I correctly access the session variable.

    Hello

    What I understand, it's that you have ViewObject based on the entity object this object attribute 'X' view and you must set this attribute with a value in the session scope.

    You can set this programmatic as attribute:

    setX(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(sessionScopeVariableName));
    

    You can add this line in doDML() in EntityImpl as:

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation != DML_DELETE)
        {
          setX(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(sessionScopeVariableName));
        }
        super.doDML(operation, e);
      }
    
  • Spry form validation Date with default value error

    The spry form validation below was created with DW CS6

    I created an HTML form and displayed with PHP to a MySQL database.  One of the lines of form is to enter a date.  This line uses a 'out of the box' sprytextfield data validation without changes to its CSS or JS:

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > Date beginning? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" >

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    < script type = "text/javascript" >

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    < /script >

    On request, the form value is captured via PHP and date format is converted to a format of MySQL before entering in the database.

    PHP

    $servComDate = date ("Y-m-d", strtotime($_POST['servComDate']));

    It all works perfectly.

    Now, I created another page with a HTML form to change information.  First, PHP takes the field in the database and converts it to MySQL format to the format used in the sprytextfield above, in which it was created.

    PHP

    $servComDate = strftime ("% m/%d/%Y", strtotime ($row ["servComDate"]));

    Then the HTML form is filled with existing value

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > if the Service is coming soon, do you know when the service will begin offered? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" value = "<?" PHP echo $servComDate;? > ">"

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    By filling in the form with existing value appears with the right in the box format, it shows these 'mistakes ':

    value is required. Format invalid.

    As I said above, I have not changed the CSS or JS that is loaded with the Spry textfield, so I don't get that here.

    I'm obviously something wrong with pre-filling a Spry textfield with a default value.

    What is the real need have a default value on a Textfield of Date Validation Spry?

    Thanks in advance!

    Make sure that, in the page change the constructor looks like

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    The following works fine for me

    ">

    A value is required. Format invalid.

    GRAMPS

  • I can't save the numeric values in the table

    When I close the program and run it again, all the values in the array are initialized to zero. I want to have the same previous values that I entered the table before.

    Thanks for your help!

    "' If you still want the same values at the beginning, simply enter all the values in the controls, the ' edit..make the current default values. Save the VI.

  • Unable to save the good value error - 3020 hub

    We have a production 3020 VPN concentrator, who has started having a problem a couple of days. When we make a change, we receive a popup box saying could not save a bad value error. We restarted the concentrator once and found that it did not have to register once. Now, back to the error. Because it is a production supporting many tunnels, restarting is very disruptive, and we lose all our changes. Any ideas on what causes this error and how to fix it?

    Excellent! good to hear, remember messages useful rate.

  • date fill in the dimension with the correct values

    Hi all

    I have a 'simple' problem, but can't get it resolved! The calculations of the CDA in the cube not 'reset' at the right moment in time (they should 'reset' on the exercise, but it actually seems to happen on the normal calendar year).

    Our dimensions and cubes are MOLAP. There is a relational table that contains columns with values for both a calendar hierarchy as well as a hierarchy of exercise. This table tells the date dimension (only the tax hierarchy as MOLAP, we have just a fiscal hierarchy). The result seems correct in the data viewer.

    The cube is filled with both relational sources. A perspective provides the measurement values and CODE (distinctive signs of business) values for each dimension involved. In the case of the date dimension, it provides the code for the involved level value in which we cube (months).

    I made a very simple testcase with only 1 dimension (date) and 1 small cube. The cube uses only the dimesion of date (to load the cube on the fiscal hierarchy at the month level) and has 1 base measure that is loaded with a simple number and 1 calculated measure that calculates the value of the CDA for this basic measure. The calculated measure is added to the cube designer OWB by using the button 'generate calculated measures' and choosing the function 'Year to Date'.

    When complete the cube and using the data viewer to verify the results, CDA values don't 'reset' at the end of the year. They seem to reset at the end of the normal calendar year!
    After some tests, I have concluded that this has to do with the values I provide to fill the date dimension, but I can't figure out what should be the change, and I can't find examples anywhere.

    Someone out there a calculation for a YEAR of work in MOLAP?

    Any help much appreciated.
    Kind regards
    Ed

    Hi Ed

    It can be an inherent behavior of the time dimension in the AWs where the CDA on financial is not supported out of the box, see the OLAP thread below. Have you tried just build your simple case in AWM recreate? If you can get around using a custom expression, you should be able to define this custom OWB and still keep the design you have.

    Calculated against calendar CDA CDA tax measure

    See you soon
    David

Maybe you are looking for