This discussion is archived
7 Replies Latest reply: Apr 5, 2013 10:43 AM by Howard (... in Training) RSS

insert custom value from page item in submit process message

gpoz Newbie
Currently Being Moderated
version 4.2.1 on 11g 11.1 (AIX): I am building an app with a custom process executed on submit, after validations. This will execute a PLSQL proc to which I am passing one argument, an ID value. I am wishing to display this ID value in the custom process messages for success or failure, but not finding the right way to do this, as APEX appears to consider my expression as data, not a reference to a variable. I have tried the various forms of variable reference in the documentation, but not having good luck. Can anyone straighten me out on this method? Latest outcome is this, although the 1st 2 words are from APEX:

Action Processed. updates completed for ID '&p2_data_id.'
  • 1. Re: insert custom value from page item in submit process message
    Nattu Explorer
    Currently Being Moderated
    Hi,

    You can create a page hidden item like pxxx_success_message and compute a value for it (your custom value, you can assign the value to this item in your process itself) and in the "Messages" section for the process, in the process success message text box type &PXXX_SUCCESS_MESSAGE.
  • 2. Re: insert custom value from page item in submit process message
    gpoz Newbie
    Currently Being Moderated
    thank you for your input, but I am not seeing how this will make a difference. I am already placing my custom message in that location, but the &pxxx_var. is not being interpreted into a value, it seems to think the "&pxxx_va." IS the value to display.
  • 3. Re: insert custom value from page item in submit process message
    Howard (... in Training) Pro
    Currently Being Moderated
    Sounds to me like what you have should work. Here's what works for me. I have a PL/SQL Anonymous Block with a Process Point of On Submit - After Computations and Validations. It has Process Success and Process Failure Messages and I put in the value just like you have.
    CANCEL reset succeeded for '&P3_ST.'.
    And it works for me.

    Howard
  • 4. Re: insert custom value from page item in submit process message
    Howard (... in Training) Pro
    Currently Being Moderated
    If you have some kind of secure that forces values to be taken literally and not parsed, then everything in your message would be displayed without substitution. Are some regions or fields "escaped" / "not escaped"?

    Howard
  • 5. Re: insert custom value from page item in submit process message
    Nattu Explorer
    Currently Being Moderated
    Strange, &Pxxx_ITEM. is the substitution string and used with the html codes. As Howard said, it works for me also. Just a guess, try with the surrounding quotes?
  • 6. Re: insert custom value from page item in submit process message
    gpoz Newbie
    Currently Being Moderated
    Howard, you're not going to believe this .... I put the name of the page item in caps, and it worked perfectly, just as you said. How silly is that.

    So I tired it in reverse .. back to lower case ... AND IT FAILED AGAIN as I originally described.

    thanks to both for your contributions to my understanding.
  • 7. Re: insert custom value from page item in submit process message
    Howard (... in Training) Pro
    Currently Being Moderated
    Congrats. I'm going to have to reread the documentation. I was thinking APEX item names were case agnostic like Oracle. Maybe that's not the "case" -- pun intended!

    (more) Lower case fails for me as well. Treats as a literal. And when I change an item name to mixed case in it's definition, for example "p3_ITEM", it uppercases when it saves. ???? I wish it could check for this and ask, "Did you intend to use LC here?" But that would require a longer parse.

    Howard

    From Arie Geller's book: http://books.google.com/books?id=YlQ7fxI34wkC&pg=PT222&lpg=PT222&dq=must+apex+items+be+upper+case&source=bl&ots=oXRhpm8dZm&sig=VSOMai9y0Vwa0pKQw2UIxVdwcvA&hl=en&sa=X&ei=_wpfUdgVh7zzBM71gBg&ved=0CGMQ6AEwBg
    Note especially the last part!
    Case sensitive APEX item names
    There is a greater confusion regarding the case sensitivity of APEX item names.
    While defning a new APEX item, we can use any combination of case letters, but the
    Application Builder wizard will convert any lower or mixed case item name into an all
    uppercase name.
    Within SQL or PL/SQL code, item names are not case-sensitive (just like any other
    bind variables). This is also the case when we are using them in declarative felds
    within the Application Builder.
    If we want to retrieve an item value using the &ITEM. substitution string notation
    then the item name must be in uppercase. Otherwise, the APEX engine will treat
    it as a regular string.>

    So there you have it!
    Edited by: Howard (... in Training) on Apr 5, 2013 1:43 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points