Post Calculation Computation - Trim

I have an item with the source type of Database column that's coming in with a single space.
when display on the page the user has to delete the space to clear out the space.
I've tried the "Post Calculation Computation" which is pretty straight forward with the Trim and the space still appears.
What I've tried.
Trim(:P8_FUND)
Ltrim(:P8_FUND,' ')
nullif(:P8_FUND,' ')
Non of the above are working.
When I tried the next statement just for a test, the space was removed and the xx appeared, so I can't figure way the above examples won't work????
TRIM(:P8_FUND) || 'xx'

I'm using Apex 3.2.
I created a Trim function and added it to my Load_Start function and the item still has the leading space.
Do you see anything in my code that's not right?
HTML Body
onLoad="Load_Start()";
HTML Header
function Load_Start()
hide_item('P8_FRS_ACCT','P8_HIDE_COL1');
hide_item('P8_FRS_SUBCODE','P8_HIDE_COL1');
hide_popuplov('P8_FUND_CODE','P8_HIDE_COL1');
hide_popuplov('P8_ORGN_CODE','P8_HIDE_COL1');
hide_popuplov('P8_ACCT_CODE','P8_HIDE_COL1');
hide_popuplov('P8_PROG_CODE','P8_HIDE_COL1');
hide_popuplov('P8_ACTV_CODE','P8_HIDE_COL1');
hide_popuplov('P8_ACCI_CODE','P8_HIDE_COL1');
hide_popuplov('P8_LOC_CODE','P8_HIDE_COL1');
hide_item('P8_FRS_OFFSET_ACCT','P8_HIDE_COL2');
hide_item('P8_FRS_OFFSET_SUBCODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_FUND_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_ORGN_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_ACCT_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_PROG_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_ACTV_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_ACCI_CODE','P8_HIDE_COL2');
hide_popuplov('P8_OFFSET_LOC_CODE','P8_HIDE_COL2');
setFocus('P8_PAGE_FOCUS');
trim('P8_FUND_CODE',' ');
if ($x('P8_FI_ACCOUNT_TYPE').value != "F")
{$x_HideItemRow('P8_FRS_ACCT');
$x_HideItemRow('P8_FRS_SUBCODE');
function trim(str, chars) {
     return ltrim(rtrim(str, chars), chars);
}

Similar Messages

  • Some basic post-calculation computation

    maybe I just have the syntax wrong....
    I'd like to default a field to the value of another field entered earlier in the same page.
    Say a customer has a short name and a long name.
    I don't want the long name to be blank, so it should contain the short name unless something better is entered.
    My ideal scenario is that if no long name is entered (ie the user leaves the field empty and moves onto the next field), the short name should be defaulted into the long name (and redisplayed, ideally). If this is not achievable, I would settle for pushing the short name into the long name field (and displaying it) to serve as a default before the user even has a chance to enter or skip the long name.
    I tried the following post-calculation computation
    IF P12_LNAME IS NULL THEN
    P12_LNAME := P12_SNAME;
    END IF;
    This gives a runtime error, complaining about the unexpected IF. (As an aside, can't the sysntax be checked at definition time instead of waiting until run time?)
    I'm not quite clear on whether these page items need a preceding colon or not, but the "IF" problem prevents me from experimenting with both naming conventions.
    I'm sure I could write a function to achieve the defaulting, and maybe I could also do something in the validations, but I suspect a more straightforward solution exists and I hope a more knowledgeable practioner can show me how silly I am.

    Sure. Now that I know how to validate with ease, I will be tightly checking all the user entered fields. I will default as we discussed earlier when fields are null, and other fields will be converted to upper case. all these fields will be entered into a series of fields in a single page region.
    what I'd like to do, before saving to the database, is to redisplay the same group of fields the user has entered, showing the modifed entries after my validations and post-calc computations, so that the user can see exactly what is about to be saved. I'd rather not have to create a whole new page just to do this if possible.
    I guess I just want to re-render the same page with the current page field values.
    CS

  • Post Calculation Computation for Date/Timestamps

    Hello,
    I would like to know how to apply Post Calculation Computation for Dates/Timestamps?
    I had trouble trying to add this to the Post Calculation Computation area:
    TO_CHAR(:P1_TARGETDATE, :DEFAULT_DATE_TIME_MASK);
    or should it be something more like:
    SELECT
    TO_CHAR(:P1_TARGETDATE, :DEFAULT_DATE_TIME_MASK) FROM DUAL;
    What would be the correct code to allow me to format a date/Timestamp where a Application Variable of DEFAULT_DATE_TIME_MASK could be used as well. (I dont want to use the existing Format Mask.)

    Just a hunch, but you might be having a problem because of the double quotes. Oracle likes single quotes. You also might want to forgo the quotes entirely.
    As for an invalid number, is it possible that one of the values that you are adding might be NULL. You can't add NULL to a number or you get an error. There are two solutions to that. One would be to do an NVL around each number you are adding (changing it to zero if the value is NULL). The second option (and easier option) is to use the SUM function. Mathematical functions like SUM and AVG ignore those values that are NULL.

  • Post Calculation Computation example for query source

    Hello,
    It's my understanding that the Format Mask filed in the Source section of the Edit Page Item is for database columns. I've been trying to find sample code on how to use a format mask for a field that uses a SQL Query as it's Source.
    Here is my query:
    SELECT :P3_CONSTR_COST + :P3_AQUISIT_COST + :P3_SECURITY_COST + :P3_HOUSING_COST + :P3_DESIGN_COST + :P3_AWFEE_COST
    FROM DUAL
    Can you please let me know how I can format it to display like: 999,999,990
    Thank you for your assistance....

    Just a hunch, but you might be having a problem because of the double quotes. Oracle likes single quotes. You also might want to forgo the quotes entirely.
    As for an invalid number, is it possible that one of the values that you are adding might be NULL. You can't add NULL to a number or you get an error. There are two solutions to that. One would be to do an NVL around each number you are adding (changing it to zero if the value is NULL). The second option (and easier option) is to use the SUM function. Mathematical functions like SUM and AVG ignore those values that are NULL.

  • ERROR-1079 Error in item post calculation computation

    hi,
    We are getting this error when the user is clicking on a "Submit" button. Below the error there is an Oracle -20000 (ORA-01422) error is getting displayed. In order to debug the issue i need to understand a way of knowing the underlying database procedure that is being called.
    Is there a role that we need to set which will give us developer access to the application that has been developed using HTML DB so that i can look at the procedure that is called from the button or is there some other way of doing so?
    Would appreciate your response on the same.
    Regards,

    Shalini - You need to use the service administration application to create a user in the workspace that owns your applications (Oracle). Use the url ../pls/htmldb/htmldb_admin (or the like) to get to the admin login page. After login, find the Manage Developers and Users link and select the workspace of your developed applications, then create a user account. Then logout from the admin application and login to the Oracle workspace with the new account credentials. Then you can use the Application Builder to examine all the applications in the workspace and you can export them too.
    Scott

  • Post calculation on database column in form

    I have a form created. for post calculation I convert text to upper case.
    upper(NAME);
    When I edit existing data in the form, and save the record. The data is converted to upper case. However when I create a new record and save it, everything is in lower case? What am I missing?
    Thanks,
    Bob

    By saying "Post calculation", do you mean a Calculation with Computation Point "After Submit"? At the Edit Page, your calculation should be in the second column - Page Processing.
    Did you go to:
    1)Edit Page
    2)"Create" icon in Page processing/Computations region
    (There is also a "Post calculation computation" property at the item level (item properties - region Source. But this function is executed at page rendering - after the data is read from the source. It is not executed when the page is submitted. This will not work the way you require.).
    If you are using Computation with processing point After Submit, go to the properties of this computation and look for Conditional Computations - there shouldn't be any condition, or you should have there something like :REQUEST = 'SAVE' or :REQUEST='CREATE'
    Also in the Computation, you should have a colon in front of the item name. So if Px_ITEM is the name of your item, than the computation should look like:
    upper(:Px_ITEM)
    Check also, if you are using the same page for insert as for update. Some application wizards create a separate page for insert and separate page for updates and deletes.

  • Post Calculation Item Formatting

    I have a form item that is not a database column. The data is a number and I would like to format it as currency. I have entered the following in the Post Calculation Computation area but am getting an error message:
    TO_CHAR(TO_NUMBER(:P25_RO_BASE_RENT), 'FML99.99')
    I have also tried without the TO_NUMBER.
    Any suggestions? Thanks.

    This is what I have under Source:
    Source Used: Always, replacing any existing value in session state
    Source Type SQL Query
    Maintain session state: Per Session
    Source Value:
    SELECT new_base_rent
    from v_las_last_change_values
    where lease_id = :P25_ID
    --Charlotte                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Poster Frame and Trim Mode not working properly with post-synced clips

    Hi Everyone-
    Final Cut Pro seems to be doing something really odd and I'm wondering if anyone else has experienced it and if so what is the fix:
    We are shooting a movie on Red with sound coming in on multitrack wav files. We downconvert the R3D files to Prores and then manually sync the tracks in the timeline.
    We link the pix and sound and drag them to the bin to make our dailies. They all play, in sync. When we try to set a poster frame the issues begin. If I load the clip into the browser park the playhead on a frame and choose poster frame, the actual frame in the bin is very noticably offset (often by a few seconds).
    Also, when I use the trim mode, the frames jump to a different part of the shot during trim. It's like the shot is jumping ahead or back while I hit the frame advance or recede buttons. Once I let go of the button the image jumps to the correct number of frames. But, it's very distracting if I am trying to trim, for example, to just before an actor blinks. I can't trim 1 frame at a time. I have to keep hitting the button, watching the picture jump to a different part of the shot, release the trim button and watch the picture jump back to the now correctly trimmed frame...
    As a test I took some of the Prores clips with scratch track sound and brought them into the bin directly from the finder, bypassing the syncing. Using those clips, the trim and poster frames work as expected. Obviously something is going on during syncing.
    I assumed maybe because the audio and pix we different lengths the clip was getting "confused", and didn't know where to "start". So, in the timeline with the synced clips, I razor bladed a few shots, linked them, and dragged them to the bin so the audio and video were the exact same length... Same issue.
    I have noticed the same behavior on 2 separate Macs so I don't think its a preference or corrupted install issue.
    Anyone seen this and have any suggestions?
    Thanks,
    David

    Yes, David, I'm having the same problem under the same circumstances. we're using merged clips made from Prores QTs and multitrk BWF files. In the trim window, the display frame jumps ahead considerably in a frame-by-frame trim, but trims accurately in the timeline. My only work-around has been to use the left/right scrub arrows in the trim window when necessary, which displays the correct frame. Sorry not to have an answer, but I saw a post on another forum from 2007 that speculated it was an FCP 6 bug. Resetting prefs doesn't help.
    Tim

  • Trying to get iphoto back on a post-Mavericks computer.

    Have a circa 2009 laptop that ran a bought and paid for version iphoto just fine.
    Foolishly tried to upgrade to Mavericks and discovered it turned the laptop into a virtual paper weight.
    Rolled back to Snow Leopard 10.6.8
    Iphoto was not included with that system disc, and now I cannot find iphoto without sourcing and buying it individually from a 3rd party.
    The computer was registered. Apple knows the system and that iphoto came with this computer, but apparently I can not just download the software again.
    Is this OK? Or is it incredibly lame?

    Once an application was going it was fine, but opening or switching between applications caused the beach ball to often spin for minutes at a time. I hadn't anticipated such a performance drop when I suggested upgrading to Maverick's.
    That is frequently due to applications or tools, that install system modifications, but have not been updated to Mavericks compatible versions. These system modifications can cause hanging, crashes, and memory leaks. Look for device drivers, plug-ins, preference panes, that you installed, while still running Snow Leopard or earlier.  The tool, Etrecheck,  that Old Toad mentioned, can help you to track down such incompatible system modifications.

  • Trim All Text Field quickly?

    Currently i got over +40 textfields which uses DML and the column is 255 VARCHAR
    Wondering if there a quick way of trimming all these fields before the update happens.
    As of right now im doing it like this... is there way a to grab all textfield and just loop and trim or something simliar....? i was thinking of using javascript and copy paste 40 names in an array and loop trim and set value but that seem ugly to me. as i have to go in to it every time if a new field is needed...
    :P1_name := trim(:P1_name)
    :P1_boat := trim(:P1_boat)
    :P1_book := trim(:P1_book)
    :P1_game := trim(:P1_game)
    :P1_phone := trim(:P1_phone)
    :Px_item := trim(:Px_item)Edited by: PandaOracle on Feb 14, 2012 2:19 PM

    Hello PandaOracle,
    >
    PandaOracle wrote:
    As of right now im doing it like this... is there way a to grab all textfield and just loop and trim or something simliar....? i was thinking of using javascript and copy paste 40 names in an array and loop trim and set value but that seem ugly to me.
    >
    Instead of JavaScript there is a jQuery solution to you problem. Here is a JavaScript function you can call on your Submit button of your page:
    function f_trim_textb() {
      //trim all the text fields
      $('input[type="text"]').each(function() {
       oval = $(this).val();
       tval = $.trim(oval);
       $(this).val(tval);
      //submit the page
      apex.submit({request:"SUBMIT"});
    }Refer: http://api.jquery.com/jQuery.trim/
    Well however this is not the only solution! You can use PL/SQL process that executes before page submit and do thing what you have suggested above:
    :P1_name := trim(:P1_name)
    :P1_boat := trim(:P1_boat)
    :P1_book := trim(:P1_book)
    :P1_game := trim(:P1_game)
    :P1_phone := trim(:P1_phone)
    :Px_item := trim(:Px_item)Yet another solution is setting the attribute Post Calculation Computation in the Source section of Item Attributes to:
    trim(:Px_item)Hope it helps!
    Regards,
    Kiran

  • How to avoid leading space -char(160) in Apex items

    Hi
    I'm getting a leading space in one of my apex item (text area).
    Further check reveals that it is char(160).
    Could any one help me in this to avoid leading space in the item.
    Many Thanks
    --Vijay                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Vijay,
    Try:
    TRIM(:<Item_Name>)In the Post Calculation Computation section of the item.
    Hope this helps.
    Regards
    Kamo

  • 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

  • Store dates in UTC, view in SESSIONTIMEZONE

    Hi,
    I have users in many time zones - each with daylight savings rules - and I want to store dates on the database in UTC/GMT.
    In order to get them displaying in local time in ApEx, I have done the following:
    - Set the SESSIONTIMEZONE in the VPD security section
    - Convert from UTC to SESSIONTIMEZONE in the "Post Calculation Computation" option of the screen item as it is displayed
    - Convert from SESSIONTIMEZONE to UTC in a Calculation when the row is saved back
    I have tried to get this working with the data type TIMESTAMP WITH TIME ZONE. It does the conversion to UTC OK, but the time zone stored on the database is the SESSIONTIMEZONE. I have to stick to the format model associated with the ApEx DatePicker I am using, which does not include a time zone, so I cannot explicitly instruct the Automatic Row Processing which zone to write.
    Surely there is an easier way.
    Should I just abandon the TIMESTAMP WITH TIME ZONE and go with TIMESTAMP or DATE? Then the UTC zone would just be implicit on the database.

    Check out the already existing thread about this: iTunes8 - How to turn off genre and links to shop in the browser?

  • Date Field Displaying and DML Operations

    Hi all,
    I have an issue with displaying and updating date columns that I'm hoping someone can assist me with.
    I'm using APEX 3.0.1.
    I have a Form page with a number of fields sourced from one database table that are being populated by an Automatic Row Fetch On Load - After Header.
    The Item P6_MONTHFOR is stored as a Date datatype in the table and displayed on the form using the Date Picker (use Item Format Mask). I have a Format Mask set as 'MON-RR'. I want to ensure that the last day of the month is saved back to the database table so have been trying various calculation techniques to try and achieve this but am experiencing a variety of SQL errors!
    I have tried using LAST_DAY(:P6_MONTHFOR) in the Post Calculation Computation, or as a separate Computation After Submit.
    I have also tried having P6_MONTHFOR as a hidden column and using display Items and then trying Item calculations to then update the value of P6_MONTHFOR column prior to DML operations but to no avail.
    The only DML operations allowed on these rows are DELETE and UPDATE and I'm using an Automatic Row Processing (DML) On Submit - After Computations and Validations process to control these operations.
    Any help or suggestions greatly appreciated :-)
    Kind Regards,
    Gary.

    the function LAST_DAY is a date function, expecting a date as input. Since it is all web, the values of items are as string/varchar2. In order to use date-function, you have to first make it a date with to_date() with the format-mask (DD-MON-RR).
    In my opinion Dates are still tricky, it would be great if ApEx would have a DV() function, next to the V() and NV() functions, It is in ApExLib (of Patrick Wolf)
    Simon

  • HTMLDB_ITEM.SELECT_LIST_FROM_QUERY - not found error

    Hi!
    I am trying to use HTMLDB_ITEM.SELECT_LIST_FROM_QUERY in a page source and getting the error message: ORA-06550: line 2, column 4: PLS-00221: 'SELECT_LIST_FROM_QUERY' is not a procedure or is undefined.
    This is HTMLDB 2.0 on Oracle 10.2.0.1.0 on Windows 2000.
    All help is appreciated.
    Thanks!
    Dave Venus

    Chet, I am still having trouble making this work. Let me cover each of the fields in the form and lets see where I am going wrong...... Sections with only a header have the default values.
    Name Section:
    Page: 4
    Name: P4_GROUP_ID
    Display As: Select List
    Displayed Section:
    Sequence: 20
    Region:
    Begin on new line: YES Field: YES ColSPan: 1 RowSpan: 1
    Label Section:
    Element Section:
    Source Section:
    Source Used: Only when current value is session state is null
    Source Type: Static Assignment (value equals source attribute)
    Source Value or Expression: P4_GROUP_ID
    Post Calculation Computation:
    Format Mask:
    Default Section:
    List of Values Section:
    Named LOV: Group_Names
    Display Extra Values: No
    Columns: 1
    Display Null: Yess
    Null Display Value: -- Select Group --
    List of Values definition: select group_name display, group_id return
    from #OWNER#.ittp_group
    ordeer by 1
    Security Section:
    Conditions Section:
    Condition Type: - Item Not Conditional
    Read Only Section:
    Read Only Condition Type: Value of Item in Expression 1 is NOT NULL
    Expression 1: P4_GROUP_ID
    Expression 2:
    Help Text Section:
    Configuration Section:
    Comments Section:
    I really appreciate your time, patience and help!
    Dave Venus

Maybe you are looking for