Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Button to increment field

Alexandra RobinDec 1 2010 — edited Feb 23 2011
I've been out due to surgery for three weeks and have no idea how I got this to work before leaving...somehow it's not working anymore... Thanks in advance for your help...

This is Form on a Table with Report to catalog our in-house documents.
1. I'm passing the form/table's PK ID into a display-only item called :P51_DOCNO (i.e., 2656) that will be used as the filename of the document being catalogued.
2. If the user ever updates the form, there must be a revision number for that document (i.e., 2656A). I've created an item called :P51_REVISION that will hold the revision number. I tested this code before surgery and it worked then. It mostly works now but the way I had it set up I couldn't get past 'A.'
SELECT CASE  
when ASCII(SUBSTR(:P51_DOCNO,LENGTH(:P51_DOCNO),1)) >= 65 
then
SUBSTR(:P51_DOCNO, 1, LENGTH(:P51_DOCNO)) || CHR(ASCII(SUBSTR(:P51_DOCNO,LENGTH(:P51_DOCNO),1)) + 1)
else substr(:P51_DOCNO, 1,LENGTH(:P51_DOCNO)) || 'A'
END
FROM DOC_INFO
WHERE DOC_INFO_ID = :P51_DOC_INFO_ID;
3. To initiate this process I had a button at the top of the form called REVISION that, upon clicking, :P51_REVISION would update.
4. Somehow I used two more items (:P51_NEW_REV_DISPLAY and :P51_NEW_DOCNO) that I used to hold the current revision and the next in the sequence.
5. I remember using Request = Expression 1 and Expression 1 being REV (the button request), and I remember using some javascript in the page html header. Sorry - I don't know javascript well enough to write my own, but will be taking a class early next year.

While I was gone our Network Administrator upgraded from 3.1.x.x.x to 4.0. I don't know if this had anything to do with certain weirdnesses, or if I can just blame lingering anesthesia...but your help will be IMMENSLY appreciated.
Thank you!
This post has been answered by ATD on Jan 21 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2011
Added on Dec 1 2010
739 comments
2,209 views