Timespan - Validation Expression

I need to check wether the entered dates are within a year or not.
If not the app has to throw an exception
At the validation's page - Validation Expression 1 - window i tried the following:
Datediff (day, :P4_start, :P4_end) <=366
as type i chose SQL Expression
What's wrong with it!?
Error message:
Error ERR-1023 Unable perform validations.
ORA-06503: PL/SQL: Function returned without value

DATEDIFF is a function I know from MS SQL Server 2000, Syntax as follows:
DATEDIFF(days/months/...,'startdate', 'enddate')
the function normally returns the amount of days/months/.. that are between the two dates.
Maybe Oracle uses a totally different function/syntax to achieve the same goal!?
If so, please tell me.
Mike

Similar Messages

  • How to pass column header as a parameter in Validation Expression (APEX4.0)

    Hello
    I created a new Page validation in APEX4.0 ( not 4.1 ).
    (1) Type : Function Returning error text
    (2) Validation Expression 1 :
    begin
    return validate_name ( p_c=> #COLUMN_HEADER# ,p_c_value=> to_date(:p26_LEAVE_FROM,'dd/mm/yyyy') );
    end;
    note: the validate_name is an oracle pl/sql procedure which takes two input parameters ( column header name and actual value ) and return a specific error message ( to that column ) or NULL.
    (3) In the Error Message section, I left Error Message blank ( as the app ignored the mssage but used the one returned from the above function)
    However, I chose "The Error display location" to be inline with field and notification" and Associated Item to be "p26_LEAVE_FROM".
    My question, it worked if I hard coded the actual column header "LEAVE FROM" , but it didn't work if I used the above #COLUMN_HEADER# in Validation Expression. Can I avoid hard coding as the column header might be changed one day. Is there a better way to deal with multiple column validations with different error message for each column ? It seems that I will have to create similar page valiation for each column to be validated.
    Thanks for your advice.
    Edited by: Susanna on 19/01/2012 17:45

    You want something like this:
    DECLARE
      lio_success  VARCHAR2( 2000 );
      li_id        NUMBER;
      li_dep_id    NUMBER;
      li_sel_id := NUMBER;
      li_date DATE;
      lo_date DATE;
      lio_return_message xyz_bpe_rec_fn.xyz_bpe_rec_col;
      l_ret xyz;
    BEGIN
      lio_success := 'some value';
      li_id := NULL;     -- or some number
      li_dep_id := NULL; -- or some number
      li_sel_id := NULL; -- or some number
      li_date DATE := sysdate;
      lio_return_message.col1 := somevalue;
      lio_return_message.col2 := somevalue;
      lio_return_message.coln := somevalue;
      l_ret := get_xyz( lio_success
                      , li_id
                      , li_dep_id
                      , li_sel_id
                      , li_date
                      , lo_date
                      , lio_return_message );
    END;
    /

  • Validation expression for Comparitive check

    Hi,
    My scenario is to fire a validation error when,
    Field A is filled and Field B is not filled.
    If Field A and Field B is filled there should not be any validation error.
    Can any body send the validation expression to achieve this?
    Best regards,
    Arun prabhu S

    Hi Arun,
    According to your requirements and if I am getting it right the the validation should fire in the following cases.
    (1) Field A is filled and field B is not filled.
    (2)If both the fields are blank.
    Correct me if I am  wrong the validation should not fire if field A is blank and field B is filled.
    IF(IF(IS_NOT_NULL(Field A) OR IS_NULL(Field A),TRUE,FALSE) AND IF(IS_NOT_NULL(Field B),TRUE,FALSE),TRUE,FALSE).
    Reward if Helpful,
    Regards,
    Vinay Yadav

  • Validation expression, with a Boolean field

    Hello,
    My issue is as follow: I want to make sure that if attribute 'A' = "1"; then attribute 'B' has values.
    Note: attribute 'A' is boolean.
    I did not succeed in setting up such a formula [I succeeded in setting up the opposite formula only: 
    IF(Attribute 'A',IS_NULL(Attribute B))
    Thx for any help,
    Rémi Dusaud

    Hi Remi,
    attribute 'A' is a field of type Boolean in main table, right which has two values 1 and some other value, right?
    if this is right then i hope you have also set True Value as 1 and False Value as something in MDM Console. Because Boolean field has only two values which you can set through Console by default True value = TRUE and False Value = FALSE, here you need to change it to 1 and other value as per your requirement.
    For the same this expression works as given by me in above post.
    If this is really Attributes, name as Attribute 'A' and Attribute 'B' in taxonomy mode of data manager.
    and by Boolean you mean here that Attribute of type Text but has two values 1 and some other value.
    if this is true then you want a record in maintable is associated with a category which is linked with these two Attributes, and if Attribute 'A' has Attribute Value as 1 then Attribute B should not be null, in this case firstly you have to create a validation and then right click on this validation and then Add Branch select here Branch Value(category which is linked with these two attributes). a new validation gets created with this branch Value.
    now write expression in this Branch validation expression as same:
    IF(attribute 'A' = "1", IS_NOT_NULL(attribute 'B'))
    But here you need to select Attribute 'A' and Attribute 'B' from Attributes Tab in validation expression.
    and select "1" from Text Values Tab in validation expression.
    let me know if you still face, in both ways this expression is working fine at my end.
    Regards,
    Mandeep Saini

  • How to get result of MDM validation expression with type warning?

    I need  to get result of MDM validation expression with type WARNING (in automatic execution),
    but - method validationResult.getFailedValidations(..) returns validation if it has type ERROR,
    so all Warnings treated only as success despite it returned false or true.
    My question - how can I get that 'false or true' expression resut for validation.
    thanks

    Hello Vladimir
    By my opinion, hook warning exception isn't make sense because after warning message data will be change(upload).
    Moreover  if you start validation from WF Warning exception doesn't work at all.
    If you want to do some data changes you should use and hook Error exception.
    Regards
    Kanstantsin Chernichenka

  • Validation expression help

    Hi All,
    I have requirement like having two fields
    Status(Lookup) and Date (Literal Date)
    Business rules as follows
    1) If "Status" = "Draft" then Date value should be equals to 09/09/9999
    2) If "Status" <> "Draft" then Date value should not be equals to 09/09/9999
    I tried with validation Expression Has_Any_Values, but no use.
    Can any one please help me on this....
    Thanks
    Anil

    Hi Priti Thanks for your reply...
    I don't want to assign date in Date field.'
    Validation requirement are
    1. If i select Status = "Draft" then i can select date only 09/09/9999. It should give an error message if i select any other date except 09/09/9999
    2. If i select status other than "Draft" Ex: if i select Status "Active". Date field should not allow to select 09/09/9999.
    Shiv - I think my explanation is clear now.
    I wrote validation for 1st scenario
    IF(HAS_ANY_VALUE(Status.Name="Draft",TRUE), HAS_ANY_VALUE(Date="09/09/9999",TRUE))
    But its not working as required.
    What i came to know is if Date field Data Type is Text is working fine. But in my data model we declared Date field Data type as Literal Date. so it's not working and now i cannot change data type here we have lots of data in it.
    can any one have sugessions to implement these validations please welcome.
    Thanks,
    Anil

  • Problem with window of 'validation expression'

    Hello all,
    I have a very stupid problem and it stuck me since half an hour !!
    Indeed, i don't know how i did it but i move the window we use for creating our validation/Assignment rules (field validation expression) somewhere and i don't see it anymore. when i am clicking on the button '...', the window appears somewhere (can select it through the alt+TAB) but i cannot see it !!!!
    Is there a way to initialize this ? in order this window to come back at its standard size ???
    Thanks,
    JP

    Found the solution !!!
    For infos :
    Note 1277807 - Expression building window is not shown after launching.
    The Data Manager window for the expression builder is "missing" and is not visible after launching it.
    Solution
    It could be that the pop-up window that opens for the expression builder is "hidden" or if a two monitor set-up was used in the past it might not be visible.
    In order to find the missing window please try the following:
    1) Open an existing validation or create a new one then click on the
    three dots.
    2) Press Alt + Spacebar.
    3) Press the down arrow once and then Enter.
    4) Using the Left and Right arrow keys press one of them continuously in one direction and then the other to see if the missing dialog box will appear.
    Thanks all for your help
    Edited by: Jean-Philippe PAIN on Mar 3, 2010 4:49 PM

  • Trying to create a Field Validation Expression and need help

    I have a picklist field and another field that are in question. I want to set some sort of rule that forces the second field to be populated only If specific values are selected from the picklist field.
    I was going the route of a field validation Rule, but everything i've tried so far does not produce the results i am trying to achieve.
    The first type of expression i tried was:
    ([<plProduction_Print_Account_Category_ITAG>] <> LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print") AND ([<stSIC_Code_ITAG>] IS NULL))
    This is generating the field validation error message when i select any of the correct values from the picklist. the problem is still the second field, which will generate the error if a value is entered into the second field, regardless of the picklist value selected. Switching the "IS NULL" to "IS NOT NULL" only reverses the problem on the second field, causing the error to generate when the second field is updated to a NULL or blank value.
    I also tried :
    = 'No Production Print' AND [<stSIC_Code_ITAG>] IS NOT NULL
    and got similar results.
    ([<plProduction_Print_Account_Category_ITAG>] = LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print"))
    Similar results as well.
    Does this need to be an IIF statement? Do I need to make this a workflow expression instead? i could really use some help as I have tried everything i can think of and admit, i'm not the expression guru!!!. Any assistance would be appreciated.
    TeknoMan

    Yes we have the same request and we used the following expression. Example we have a field "Método de pago" ( [<plMtodo_de_pago_ITAG<]), it's values are "CHEQUE and DEPOSITO" if we select DEPOSITO three more fields were requiered Route, Sucursal de banco and Clabe so we have to put this validation in the four fields including Metodo de pago.
    [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL)
    well in the field CLABE we put the following [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL AND Len([<stCLABE_ITAG>])=18) this was because the len of the value must be 18 characters.
    I hope this works for you
    Regards Catalina Valadez
    Edited by: CatalinaV on 12/03/2009 10:54 AM
    Edited by: CatalinaV on 12/03/2009 10:55 AM

  • Help with validation expression

    I could really use some help. The following validation item works. It keeps new records from being submitted when the p1_units field is greater than 10.
    if v('p1_units') <= 10 then
    return null;
    else
    return 'test';
    end if;
    This is not what I want though. What I want is to use the following in place of where I have the 10.
    select s1 - s2 from
    (select sum(units) s1 from units_avail where trunc(add_date) <= trunc(sysdate) and model = '56478') t1,
    (select sum(units) s2 from orders where model = '56478') t2
    This sql statement is used else where in the application and it returns the current count of unit available by summing of the total of all orders and subtracting that from the total of all inventory receipts.
    Thanks in advance.

    Hi,
    If I understood your post correctly this PL/SQL procedure would help:
    DECLARE
    v_number NUMBER(5);--select precision and scale according to your task
    BEGIN
    select s1 - s2 into v_number
    from
    (select sum(units) s1 from units_avail
    where trunc(add_date) <= trunc(sysdate) and model = '56478') t1,
    (select sum(units) s2 from orders where model = '56478') t2;
    if v('p1_units') <= v_number then
    return null;
    else
    return 'test';
    end if;
    END;
    Val

  • Validation expression, Checking the language

    Hello,
    Beside me following problem: Check first 5 symbols of the field on belong  to one language. &#1057;an there is ideas beside who as this realize in MDM 5.5 sp3
    Thanks in advance,
    Elena

    Well, it worked for me, so I want to check that you modified the Start/End master to have the User.msvShapeCategories row with the value "Start/End", as I did?
    A Category is not a Master
    David J Parker MVP (Visio) http://blog.bvisual.net

  • SQL Expression Validation

    I created a validation and choose 'SQL Expression' as the type. And i put the following in the Validation Expression 1:
    Select 1 from Employee
    where ID = :P20_ID
    what i want to do is to check if the employee id is existed or not. If yes, it will give error message.
    It didn't work and i got these error message:
    ORA-06503: PL/SQL: Function returned without value
    Error ERR-1023 Unable perform validations.
    Could you help me?
    Thanks.
    Jen

    Hi Jen,
    the "Exists" and the "NOT Exists" validation type expects that kind of SQL statement you have defined. It executes your statement and checks if a row is returned or not.
    A "SQL Expression" expects no full SQL statement, instead it has to be an expression as written in my previous posting.
    As an example, create a new validation with the wizard and select "SQL", there you will see all the options and example codes.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/
    Message was edited by:
    patrick_wolf

  • Regular Expression Validation

    Hi,
    I'm trying to use a regular expression to validate password.
    I create a validation in my item called P502_PASSWORD. I choose regular expression type. At the Validation Expression 2, I put this expression:
    ^(?=.*\d)(?=.*[a-zA-Z])(?!.*[\W_\x7B-\xFF]).{6,15}$
    So, I tried to enter a valid "string" at this item. For example: abc123
    But it doesn't work and I don't know why. I have another item with a e-mail validation with the expression below, and works:
    ^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$
    So, i really don't know what is happening.
    Can someone help me? :)
    Thanks,
    Vivi

    Hi Vivi,
    I checked your regex with my favourite application and it seems to be correct for a 'liberal' interpreter. But POSIX-implementation in Oracle seems to be quite strict. At least, I get an ORA-12728 ("invalid range in regular expression") when executing your string with "REGEXP_LIKE". I would take the regex apart bit by bit and see when the regex starts to work with REGEXP_LIKE, like in the following example:
    BEGIN
      dbms_output.put_line(case when regexp_like('aBc123','^(((\d)|([[:alpha:]])){6,15})$') then 'hit' else 'miss' end);
    END;
    /This is of course not exactly the expression you wanted, but I guess it's not very far away and produces a 'hit'. ;)
    If anybody finds out what exactly caused the error I'd like to know. My first guess was the asterisk in combination with {6,15}, but just removing it didn't do the trick.
    -Udo

  • Item Validation using Regular Expression

    Hi,
    I am trying to apply a Validation to a text field item, with the type as Regular Expression.
    The text input into the field should be in a HH:MM:SS format, ie 05:30:00 (for 5:30am).
    The text I am placing in the 'Validation Expression 2' box is:
    [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]
    This doesn't seem to work and I get an error message when I enter text in the correct format.
    I have even tried to use other comparisons, for example:
    or
    .{8}
    but these still give me an error message.
    Anyone have any ideas?

    Thanks for your help Flavio, the Regular Expression tool is really helpful.
    When I use this tool to compare strings with my regular expression, I get output = TRUE, which means I'm getting it right, but for some reason when I copy the same Regular Expression syntax into APEX, it doesn't work.
    I try to input correct strings into the field that is validated by the Reg Expr, but it still gives me an error.
    It seems to be something I am doing wrong within the application, but I can't figure out what I'm missing.
    I am creating an Item Level Validation with details:
    Type: Regular Expression
    Validation Expression 1: P23_BUS_DAY_COVERAGE_START
    Validation Expression 2: ^(([0-1][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9]$
    Has anyone had similar problems using regualr expression validation in APEX?

  • Regular expression validates in DB but not with a apex regexp validation?

    Hi all,
    sorry if I overlooked a similar post:
    I have a page with a form and item containing this email address [email protected] that item I've made a validation of type regular expression.
    I've got my item in
    Validation expression 1 P420_EMAIL and in
    Validation expression 2 '^[a-zA-Z0-9\_\.\-]+@[a-zA-Z0-9\_\.\-]+\.[a-zA-Z]{2,4}$'If I do
    select '[email protected]'
    from    dual
    where   regexp_like('[email protected]' , '^[a-zA-Z0-9\_\.\-]+@[a-zA-Z0-9\_\.\-]+\.[a-zA-Z]{2,4}$') on the DB this returns my email address as expected.
    If I submit my form with that same email address I get my error message from my validation.
    What's the difference I'm missing between the Apex way and the DB way of validating with this regular expression?
    Thanks a lot!
    Kind regards,
    Diana

    why not rewrite the validation to the type PL/SQL expression (function returning boolean) and put this in the expression1:
    regexp_like(:P420_EMAIL , '^[a-zA-Z0-9\_\.\-]+@[a-zA-Z0-9\_\.\-]+\.[a-zA-Z]{2,4}$')
    then you're absolutely sure you are doing the right validation. If that doesn't work, try displaying the result of the validation on screen to see what goes wrong.

  • The affect of failed validation on the page rendering phase

    This is divided in two parts. In the first one I describe the behavior and in the second I show work around and make a suggestion.
    The need that started this was that the value an item needed to be recalculated each time de page was shown. This page could be called from buttons and from branches on other pages. So the logical place to put this calculation is in Computation of the Page Rendering phase. But, when a validation failed the value wasn't shown on the browser and I later discovered it was not calculated at all. I tried moving the calculation in a Process of the Page Rendering phase, but to that didn't worked either. So I needed to have a beter understanding of happens when a validation fails, ence this test.
    The test was done on version 3.1.2 of APEX.
    For this test, here is what I programmed (if no values is specified, than the property has the default value):
    1. I created a blank page
    -- In the Page Rendering part --
    2. I created a region with the following properties
    Identification
    - Title: Alpha
    - Type: PL/SQL (Anonymous block)
    Source
    - Region Source: wwv_flow.debug('&gt; RENDER REGION Alpha SOURCE');
    Conditional Display
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER REGION Alpha CONDITION'); RETURN TRUE;
    Caching
    - Caching: Cahed
    - Cache Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER REGION Alpha CACHE CONDITION'); RETURN TRUE;
    3. I created an item with the following properties
    Name
    - Name: P1_X
    - Display As: Textfield
    Displayed
    - Region: Alpha
    Source
    - Source Used: Always, replacing any existing value in session state
    - Source Type: PL/SQL Function body
    - Source value or expression: wwv_flow.debug('&gt; RENDER ITEM P1_X SOURCE'); RETURN NULL;
    - Post Calculation Computation: :P1_X || ' POST-CALCUL'
    Default
    - Default value: wwv_flow.debug('&gt; RENDER ITEM P1_X DEFAULT'); RETURN 'RENDER ITEM P1_X DEFAULT';
    - Default Value Type: PL/SQL Function body
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER ITEM P1_X CONDITION'); wwv_flow.debug('&gt; P1_X="'||:P1_X||'"'); RETURN TRUE;
    Read Only
    - Read Only Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER ITEM P1_X READ_ONLY CONDITION'); RETURN FALSE;
    4. I created a second item with the following properties
    - Name: P1_Y
    - Display As: Textfield
    Displayed
    - Region: Alpha
    Source
    - Source Used: Only when current value in session state is null
    - Source Type: PL/SQL Function body
    - Source value or expression: wwv_flow.debug('&gt; RENDER ITEM P1_Y SOURCE'); RETURN NULL;
    - Post Calculation Computation: :P1_Y || ' POST-CALCUL'
    Default
    - Default value: wwv_flow.debug('&gt; RENDER ITEM P1_Y DEFAULT'); RETURN 'RENDER ITEM P1_Y DEFAULT';
    - Default Value Type: PL/SQL Function body
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER ITEM P1_Y CONDITION'); wwv_flow.debug('&gt; P1_Y="'||:P1_Y||'"'); RETURN TRUE;
    Read Only
    - Read Only Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER ITEM P1_Y READ-ONLY CONDITION'); RETURN FALSE;
    5. I created a button with the following properties
    Name
    - Button Name: GO
    - Text Label/Alt: Go
    Displayed
    - Display in Region: Alpha
    - Button Position: Top of Region
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER BUTTON Go CONDITION'); RETURN TRUE;
    6. I created a second button with the following properties
    Name
    - Button Name: GOERRNULL
    - Text Label/Alt: Go invalid
    Displayed
    - Display in Region: Alpha
    - Button Position: Top of Region
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER BUTTON Go invalid CONDITION'); RETURN TRUE;
    7. I created a thrid button with the following properties
    Name
    - Button Name: RESET
    - Text Label/Alt: Reset cache
    Displayed
    - Display in Region: Alpha
    - Button Position: Top of Region
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER BUTTON Reset CONDITION'); RETURN TRUE;
    Optional URL Redirect
    - Target is a: Page in this Appplication
    - Page: 1
    - resetpagination for this page: checked
    - Request: RESET
    - Clear Cache: 1
    8. I created a computation with the following properties
    Item Name
    - Item Name: P1_Y
    - Type: PL/SQL Function body
    Computation Point
    - Computation Point:Before Header
    Source
    - Computation: wwv_flow.debug('&gt; RENDER CALCUL P1_Y SOURCE'); RETURN 'RENDER CALCUL P1_Y SOURCE';
    Conditional Computations
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER CALCUL P1_Y CONDITION'); RETURN TRUE;
    9. I created a process
    Name
    - Name: Beta
    - Type: PL/SQL anonymous block
    Process Point
    - Process Point: On Load - Before Header
    - Run Process: Once Per Page Visit (Default)
    Source
    - Process: wwv_flow.debug('&gt; RENDER PROC Beta SOURCE');
    Conditional Processing
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; RENDER PROC Beta CONDITION'); RETURN TRUE;
    -- In the Page Processing part --
    10. I created a computation
    Item Name
    - Item Name: P1_Y
    - Type: PL/SQL Function body
    Computation Point
    - Computation Point:After Submit
    Source
    - Computation: wwv_flow.debug('&gt; PROC CALCUL P1_Y SOURCE'); RETURN 'PROC CALCUL P1_Y SOURCE';
    Conditional Computations
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC CALCUL P1_Y CONDITION'); RETURN TRUE;
    11. I created a second computation
    Item Name
    - Item Name: P1_X
    - Type: PL/SQL Function body
    Computation Point
    - Computation Point:After Submit
    Source
    - Computation: wwv_flow.debug('&gt; PROC CALCUL P1_X SOURCE'); RETURN NULL;
    Conditional Computations
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC CALCUL P1_X CONDITION'); RETURN TRUE;
    12. I created a validation
    Validation
    - Name: Delta
    - Type: Function Returning Boolean
    - Validation Expression 1: wwv_flow.debug('&gt; PROC VALIDATION Delta SOURCE'); RETURN FALSE;
    Error Message
    - Error Message: err msg
    - Associated Item: P1_X
    Conditionals
    - When Button Pressed: GOERRNULL (Go invalid)
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC VALIDATION Delta CONDITION'); RETURN TRUE;
    13. I created a process
    Name
    - Name: Gamma
    - Type: PL/SQL anonymous block
    Process Point
    - Process Point: On Submit - Before Computation and Validations
    - Run Process: Once Per Page Visit (Default)
    Source
    - Process: wwv_flow.debug('&gt; PROC PROC Gamma SOURCE');
    Conditional Processing
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC PROC Gamma CONDITION'); RETURN TRUE;
    14. I created a second process
    Name
    - Name: Epsylon
    - Type: PL/SQL anonymous block
    Process Point
    - Process Point: On Submit - After Computation and Validations
    - Run Process: Once Per Page Visit (Default)
    Source
    - Process: wwv_flow.debug('&gt; PROC PROC Epsylon SOURCE');
    Conditional Processing
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC PROC Epsylon CONDITION'); RETURN TRUE;
    15. I created a branch
    Point
    - Branch Point: On Submit: After Processing (After Computation, Validation and Processiong)
    Action
    - Target Type: Page in this Application
    - Page: 1
    - include process success message: checked
    Conditions
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: wwv_flow.debug('&gt; PROC BRANCH P1 CONDITION'); RETURN TRUE;
    As can be seen, I've programmed all condition to be true and therefore making all objects do thier calculations.
    Here is the debug output when we click on "Go". (a line number was added for easy refence)
    {color:#999999}001 0.05: A C C E P T: Request="GO"
    002 0.09: Metadata: Fetch application definition and shortcuts
    003 0.09: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us
    004 0.09: alter session set nls_language="AMERICAN"
    005 0.09: alter session set nls_territory="AMERICA"
    006 0.09: NLS: CSV charset=WE8MSWIN1252
    007 0.09: ...NLS: Set Decimal separator="."
    008 0.09: ...NLS: Set NLS Group separator=","
    009 0.09: ...NLS: Set date format="DD-MON-RR"
    010 0.09: ...Setting session time_zone to -05:00
    011 0.09: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    012 0.09: Session: OK to reuse builder session for user:APEX_PUBLIC_USER
    013 0.09: Fetch session state from database
    014 0.10: ...Check session 2800365259756461 owner
    015 0.10: ...Metadata: Fetch Page, Computation, Process, and Branch
    016 0.10: Session: Fetch session header information
    017 0.10: ...Metadata: Fetch page attributes for application 202, page 1
    018 0.10: ...Validate item page affinity.
    019 0.10: ...Validate hidden_protected items.
    020 0.10: ...Check authorization security schemes
    021 0.10: Session State: Save form items and p_arg_values
    022 0.10: ...Session State: Save Item "P1_X" newValue="RENDER ITEM P1_X DEFAULT POST-CALCUL" "escape_on_input="N"
    023 0.10: ...Session State: Saved Item "P1_Y" New Value="RENDER CALCUL P1_Y SOURCE POST_CALCUL"
    024 0.10: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    025 0.11: {color}{color:#ff9900}&gt; PROC PROC Gamma CONDITION{color}{color:#999999}
    026 0.11: ...Process "Gamma": PLSQL (ON_SUBMIT_BEFORE_COMPUTATION) wwv_flow.debug('&gt; PROC PROC Gamma SOURCE');
    027 0.11: {color}{color:#ff9900}&gt; PROC PROC Gamma SOURCE{color}{color:#999999}
    028 0.11: Branch point: BEFORE_COMPUTATION
    029 0.11: Computation point: AFTER_SUBMIT
    030 0.11: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_Y
    031 0.11: {color}{color:#ff9900}&gt; PROC CALCUL P1_Y CONDITION{color}{color:#999999}
    032 0.11: ...Perform computation of item: P1_Y, type=FUNCTION_BODY
    033 0.11: ...Performing function body computation
    034 0.12: {color}{color:#ff9900}&gt; PROC CALCUL P1_Y SOURCE{color}{color:#999999}
    035 0.12: ...Session State: Saved Item "P1_Y" New Value="PROC CALCUL P1_Y SOURCE"
    036 0.12: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_X
    037 0.12: {color}{color:#ff9900}&gt; PROC CALCUL P1_X CONDITION{color}{color:#999999}
    038 0.12: ...Perform computation of item: P1_X, type=FUNCTION_BODY
    039 0.12: ...Performing function body computation
    040 0.12: {color}{color:#ff9900}&gt; PROC CALCUL P1_X SOURCE{color}{color:#999999}
    041 0.12: ...Session State: Saved Item "P1_X" New Value=""
    042 0.12: Tabs: Perform Branching for Tab Requests
    043 0.12: Branch point: BEFORE_VALIDATION
    044 0.12: Perform validations:
    045 0.12: {color}{color:#ff9900}&gt; PROC VALIDATION Delta CONDITION{color}{color:#999999}
    046 0.12: ...PL/SQL "function body returning boolean" Validation: wwv_flow.debug('&gt; PROC VALIDATION Delta SOURCE'); RETURN :REQUEST 'GOERRNULL';
    047 0.12: {color}{color:#ff9900}&gt; PROC VALIDATION Delta SOURCE{color}{color:#999999}
    048 0.13: Branch point: BEFORE_PROCESSING
    049 0.13: Processing point: AFTER_SUBMIT
    050 0.13: {color}{color:#ff9900}&gt; PROC PROC Epsylon CONDITION{color}{color:#999999}
    051 0.13: ...Process "Epsylon": PLSQL (AFTER_SUBMIT) wwv_flow.debug('&gt; PROC PROC Epsylon SOURCE');
    052 0.13: {color}{color:#ff9900}&gt; PROC PROC Epsylon SOURCE{color}{color:#999999}
    053 0.13: Branch point: AFTER_PROCESSING
    054 0.13: ...Evaluating Branch: AFTER_PROCESSING type: "REDIRECT_URL" button: (No Button Pressed) branch: wwv_flow.debug('&gt; PROC BRANCH P1 C5NDITION'); RETURN TRUE;
    055 0.14: {color}{color:#ff9900}&gt; PROC BRANCH P1 CONDITION{color}{color:#999999}
    0.00:
    0.00: S H O W: application="202" page="1" workspace="" request="" session="2800365259756461"
    0.00: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    056 0.00: alter session set nls_language="AMERICAN"
    057 0.00: alter session set nls_territory="AMERICA"
    058 0.00: NLS: CSV charset=WE8MSWIN1252
    059 0.00: ...NLS: Set Decimal separator="."
    060 0.00: ...NLS: Set NLS Group separator=","
    061 0.00: ...NLS: Set date format="DD-MON-RR"
    062 0.01: ...Setting session time_zone to -05:00
    063 0.01: NLS: Language=en-us
    064 0.01: Application 202, Authentication: CUSTOM2, Page Template: 2204612885682472
    065 0.01: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    066 0.01: ...ok to reuse builder session for user:APEX_PUBLIC_USER
    067 0.01: ...Application session: 2800365259756461, user=APEX_PUBLIC_USER
    068 0.01: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    069 0.01: Session: Fetch session header information
    070 0.01: ...Metadata: Fetch page attributes for application 202, page 1
    071 0.01: Fetch session state from database
    072 0.01: Branch point: BEFORE_HEADER
    073 0.01: Fetch application meta data
    074 0.02: Computation point: BEFORE_HEADER
    075 0.02: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_Y
    076 0.02: {color}{color:#ff9900}&gt; RENDER CALCUL P1_Y CONDITION{color}{color:#999999}
    077 0.02: ...Perform computation of item: P1_Y, type=FUNCTION_BODY
    078 0.02: ...Performing function body computation
    079 0.02: {color}{color:#ff9900}&gt; RENDER CALCUL P1_Y SOURCE{color}{color:#999999}
    080 0.02: ...Session State: Saved Item "P1_Y" New Value="RENDER CALCUL P1_Y SOURCE"
    081 0.02: Processing point: BEFORE_HEADER
    082 0.02: {color}{color:#ff9900}&gt; RENDER PROC Beta CONDITION{color}{color:#999999}
    083 0.02: ...Process "Beta": PLSQL (BEFORE_HEADER) wwv_flow.debug('&gt; RENDER PROC Beta SOURCE');
    084 0.02: {color}{color:#ff9900}&gt; RENDER PROC Beta SOURCE{color}{color:#999999}
    085 0.02: Show page template header
    086 0.03: Computation point: AFTER_HEADER
    087 0.03: Processing point: AFTER_HEADER
    088 0.03: Computation point: BEFORE_BOX_BODY
    089 0.03: Processing point: BEFORE_BOX_BODY
    090 0.03: Region: Alpha
    091 0.03: {color}{color:#ff9900}&gt; RENDER REGION Alpha CONDITION{color}{color:#999999}
    Alpha
    092 0.03: {color}{color:#ff9900}&gt; RENDER BUTTON Go CONDITION{color}{color:#999999}
    093 0.03: {color}{color:#ff9900}&gt; RENDER BUTTON Go invalid CONDITION{color}{color:#999999}
    094 0.03: {color}{color:#ff9900}&gt; RENDER BUTTON Reset CONDITION{color}{color:#999999}
    Go Go invalid Reset cache
    095 0.03: {color}{color:#ff9900}&gt; RENDER ITEM P1_X CONDITION{color}{color:#999999}
    096 0.03: &gt; P1_X=""
    097 0.03: {color}{color:#ff9900}&gt; RENDER ITEM P1_X READ_ONLY CONDITION{color}{color:#999999}
    098 0.03: Item: P1_X TEXT
    099 0.03: {color}{color:#ff9900}&gt; RENDER ITEM P1_X SOURCE{color}{color:#999999}
    100 0.03: {color}{color:#ff9900}&gt; RENDER ITEM P1_X DEFAULT{color}{color:#999999}
    X RENDER ITEM P1_X DEFAULT POST-CALCUL
    101 0.03: {color}{color:#ff9900}&gt; RENDER ITEM P1_Y CONDITION{color}{color:#999999}
    102 0.03: &gt; P1_Y="RENDER CALCUL P1_Y SOURCE"
    103 0.04: {color}{color:#ff9900}&gt; RENDER ITEM P1_Y READ-ONLY CONDITION{color}{color:#999999}
    104 0.04: Item: P1_Y TEXT
    Y RENDER CALCUL P1_Y SOURCE POST_CALCUL
    105 0.04: {color}{color:#ff9900}&gt; RENDER REGION Alpha SOURCE{color}{color:#999999}
    106 0.04: Computation point: AFTER_BOX_BODY
    107 0.04: Processing point: AFTER_BOX_BODY
    108 0.04: Computation point: BEFORE_FOOTER
    109 0.04: Processing point: BEFORE_FOOTER
    110 0.04: Show page tempate footer
    111 0.04: Computation point: AFTER_FOOTER
    112 0.04: Processing point: AFTER_FOOTER
    113 0.04: Log Activity:
    114 0.04: Execute Count=0
    115 0.04: End Show:{color}
    Here is the debug output when we click on "Go invlid". (a line number was added for easy refence)
    {color:#999999}201 0.14: A C C E P T: Request="GOERRNULL"
    202 0.19: Metadata: Fetch application definition and shortcuts
    203 0.19: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us
    204 0.19: alter session set nls_language="AMERICAN"
    205 0.19: alter session set nls_territory="AMERICA"
    206 0.19: NLS: CSV charset=WE8MSWIN1252
    207 0.19: ...NLS: Set Decimal separator="."
    208 0.20: ...NLS: Set NLS Group separator=","
    209 0.20: ...NLS: Set date format="DD-MON-RR"
    210 0.20: ...Setting session time_zone to -05:00
    211 0.24: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    212 0.24: Session: OK to reuse builder session for user:APEX_PUBLIC_USER
    213 0.24: Fetch session state from database
    214 0.29: ...Check session 2800365259756461 owner
    215 0.29: ...Metadata: Fetch Page, Computation, Process, and Branch
    216 0.29: Session: Fetch session header information
    217 0.29: ...Metadata: Fetch page attributes for application 202, page 1
    218 0.30: ...Validate item page affinity.
    219 0.30: ...Validate hidden_protected items.
    220 0.30: ...Check authorization security schemes
    221 0.30: Session State: Save form items and p_arg_values
    222 0.31: ...Session State: Saved Item "P1_X" New Value="RENDER ITEM P1_X DEFAULT POST-CALCUL"
    223 0.31: ...Session State: Saved Item "P1_Y" New Value="RENDER CALCUL P1_Y SOURCE POST_CALCUL"
    224 0.31: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    225 0.32: {color}{color:#ff9900}&gt; PROC PROC Gamma CONDITION{color}{color:#999999}
    226 0.32: ...Process "Gamma": PLSQL (ON_SUBMIT_BEFORE_COMPUTATION) wwv_flow.debug('&gt; PROC PROC Gamma SOURCE');
    227 0.32: {color}{color:#ff9900}&gt; PROC PROC Gamma SOURCE{color}{color:#999999}
    228 0.33: Branch point: BEFORE_COMPUTATION
    229 0.33: Computation point: AFTER_SUBMIT
    230 0.33: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_Y
    231 0.34: {color}{color:#ff9900}&gt; PROC CALCUL P1_Y CONDITION{color}{color:#999999}
    232 0.34: ...Perform computation of item: P1_Y, type=FUNCTION_BODY
    233 0.34: ...Performing function body computation
    234 0.34: {color}{color:#ff9900}&gt; PROC CALCUL P1_Y SOURCE{color}{color:#999999}
    235 0.34: ...Session State: Saved Item "P1_Y" New Value="PROC CALCUL P1_Y SOURCE"
    236 0.34: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_X
    237 0.34: {color}{color:#ff9900}&gt; PROC CALCUL P1_X CONDITION{color}{color:#999999}
    238 0.34: ...Perform computation of item: P1_X, type=FUNCTION_BODY
    239 0.34: ...Performing function body computation
    240 0.35: {color}{color:#ff9900}&gt; PROC CALCUL P1_X SOURCE{color}{color:#999999}
    241 0.35: ...Session State: Saved Item "P1_X" New Value=""
    242 0.35: Tabs: Perform Branching for Tab Requests
    243 0.35: Branch point: BEFORE_VALIDATION
    244 0.35: Perform validations:
    245 0.75: {color:#ff9900}&gt; PROC VALIDATION Delta CONDITION{color}{color:#999999}
    246 0.76: ...PL/SQL "function body returning boolean" Validation: wwv_flow.debug('&gt; PROC VALIDATION Delta SOURCE'); RETURN FALSE;
    247 0.78: {color}{color:#ff9900}&gt; PROC VALIDATION Delta SOURCE{color}{color:#999999}
    248 0.78: ...{color}{color:#ff0000}Validation did NOT pass{color}{color:#999999}
    249 0.78: ...{color}{color:#ff0000}Inline validation error count = 1{color}{color:#999999}
    250 0.86: Show current page with inline validations
    251 0.87:
    252 0.87: S H O W: application="202" page="1" workspace="" request="" session="2800365259756461"
    253 0.87: NLS: Language=en-us
    254 0.87: Application 202, Authentication: CUSTOM2, Page Template: 2204612885682472
    255 0.88: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    256 0.88: ...ok to reuse builder session for user:APEX_PUBLIC_USER
    257 0.88: ...Application session: 2800365259756461, user=APEX_PUBLIC_USER
    258 0.88: ...Determine if user "FORD10" workspace "80447903191151509" can develop application "202" in workspace "80447903191151509"
    259 0.88: ...Metadata: Fetch page attributes for application 202, page 1
    260 0.88: Branch point: BEFORE_HEADER
    261 0.88: Fetch application meta data
    262 0.88: Computation point: BEFORE_HEADER
    263 0.88: ...Evaluate condition "FUNCTION_BODY" for computation of item: P1_Y
    264 0.92: {color}{color:#99cc00}&gt; RENDER CALCUL P1_Y CONDITION{color}{color:#999999}
    265 0.92: Processing point: BEFORE_HEADER
    266 0.92: ......Do not perform process because inline validation condition found.
    267 0.92: ...Do not run process "Beta", process point=BEFORE_HEADER, condition type=FUNCTION_BODY, when button pressed=
    268 0.92: ...Recompute field lables for fields in error.
    269 0.97: Show page template header
    270 1.20: Computation point: AFTER_HEADER
    271 1.20: Processing point: AFTER_HEADER
    1 error has occurred
    * Error msg
    272 1.20: Computation point: BEFORE_BOX_BODY
    273 1.20: Processing point: BEFORE_BOX_BODY
    274 1.21: Region: Alpha
    275 1.23: {color}{color:#ff9900}&gt; RENDER REGION Alpha CONDITION{color}{color:#999999}
    Alpha      
    276 1.25: {color}{color:#ff9900}&gt; RENDER BUTTON Go CONDITION{color}{color:#999999}
    277 1.25: {color}{color:#ff9900}&gt; RENDER BUTTON Go invalid CONDITION{color}{color:#999999}
    278 1.28: {color}{color:#ff9900}&gt; RENDER BUTTON Reset CONDITION{color}{color:#999999}
    Go Go invalid Reset cache
    279 1.30: {color}{color:#ff9900}&gt; RENDER ITEM P1_X CONDITION{color}{color:#999999}
    280 1.30: &gt; P1_X=""
    281 1.30: {color}{color:#ff9900}&gt; RENDER ITEM P1_X READ_ONLY CONDITION{color}{color:#999999}
    282 1.30: Item: P1_X TEXT
    X POST-CALCUL
    Error msg
    283 1.30: {color}{color:#ff9900}&gt; RENDER ITEM P1_Y CONDITION{color}{color:#999999}
    284 1.30: &gt; P1_Y="PROC CALCUL P1_Y SOURCE"
    285 1.31: {color}{color:#ff9900}&gt; RENDER ITEM P1_Y READ-ONLY CONDITION{color}{color:#999999}
    286 1.31: Item: P1_Y TEXT
    Y PROC CALCUL P1_Y SOURCE POST_CALCUL
    287 1.32: {color}{color:#ff9900}&gt; RENDER REGION Alpha SOURCE{color}{color:#999999}
    288 1.32: Computation point: AFTER_BOX_BODY
    289 1.32: Processing point: AFTER_BOX_BODY
    290 1.32: Computation point: BEFORE_FOOTER
    291 1.32: Processing point: BEFORE_FOOTER
    292 1.32: Show page tempate footer
    293 1.32: Computation point: AFTER_FOOTER
    294 1.32: Processing point: AFTER_FOOTER
    295 1.32: Log Activity:
    296 1.32: Execute Count=0
    297 1.32: End Show:{color}
    Looking at those debug output, I was able to find a workaround. Look at the line 264 and compare that to the lines 076 to 080. What I did is put the computation in the condition. This way, I'm garanteed that the calculation is always done. Here is an exemple:
    A Computation (in the Page Rendering part)
    Item Name
    - Item Name: P1_Y
    - Type: PL/SQL Function body
    Computation Point
    - Computation Point:After Submit
    Source
    - Computation: RETURN :P1_Y; -- Never executed. Look in the condition for computation
    Conditional Computations
    - Condition Type: PL/SQL Function Body Returning a Boolean
    - Expression 1: :P1_Y := COMPUTE(); RETURN FALSE;
    This works but totally break the semantics created in APEX.
    Suggestion:
    In the Page rendering phase, when a validation fails, the source compution found in a Item (in that case the value is taken from the session state), in a Computation or in Process is never executed.
    This should revised.
    Their should be a way for the programmer to choose what behavior the rendering phase will have when a validation fails other than using a workaround that might break in futur versions of APEX.
    Edited by: user4591233 on Nov 19, 2008 6:32 AM
    Edited by: user4591233 on Nov 19, 2008 6:34 AM

    Dominique,
    Thank you for the detailed problem description. Although you posted it some ten hours ago I have just now finished reading it.
    Form pages must be built so they can operate correctly when inline validation errors are displayed. The assumption (by the engine) is that session state (and package state) as it exists at the point the validations are performed is sufficient (and correct) to support the redisplay of the page without the need to fire on-load processes or computations. Session state or package state changes made by after-submit computations or after-submit/before computations/validations processes that prevent correct page behavior on the "validation redisplay" must be avoided.
    The condition types Inline Validation Errors Displayed/No Inline Validation Errors Displayed can be used for on-load events/controls (processes, computations, regions, items, ...) for which you need finer control over this behavior.
    Also, you can forgo the use of after-submit computations when the resulting alteration of session state would be inimical to proper "validation redisplay" behavior and use On Submit - After Computations and Validations processes instead.
    I hope I have understood your situation and that this answer adequately answers your questions.
    Scott

Maybe you are looking for

  • PROBLEMS SETTING UP REPORTS SECURITY FEATURE

    1. Trying to follow instructions to set up the Reports Security Feature. 2. Successfully run the script rwwwvins.sql 3.Hitting following Error " Missing string(reports_security_desc) language(us) domain (wwc)sub_domain (sec) The portlets have similar

  • Text notification ringtone

    So I've downloaded some ringtones and have no problems with phone calls and email notifications but whenever I get a text message, I first hear the ringtone followed by droid tone.  How can I get rid of the droid tone?

  • No internet via CardBus adapter

    Hello everyone, I have a Dual Adpater that osx 10.5 natively supported and ran without a problem. Upon installing Snow Leopard I noticed that the CardBus Bridge in the System Profiler shows 'No' for Driver installed, but 10.5 has it installed and wor

  • First Post. Newbie Software Install Question

    I just purchased a used Mac G5. I have the retail FC express that I have installed. I also have the FCP 4 upgrade from FCE. When I try to install the FCP 4 I get the following; Date/Time: 2006-10-29 14:22:02 -0500 OS Version: 10.3.9 (Build 7W98) Repo

  • How to pick up value

    I am running a BDC of F-07 in a Z program. In that when it runs user will enter a value in the screen field (BSEG-ZUONR) : Assignment field. I want that value for printing. But and the end of BDC im unable to collect the Value entered in that ASSIGNM