Home » Developer & Programmer » Forms » auto_line_numbering_mechanism (Forms 10g / Windows XP SP 3)
auto_line_numbering_mechanism [message #596224] Thu, 19 September 2013 03:04 Go to next message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
Hi Everyone,

I am sorry if this is a redundant question, as i failed to find answer for this one. Actually I have designed a form. The form is like a header and Lines info thing.

At line level, if user deletes a line it actually gets cancelled and only its visibility is controlled not to show up. Now I need a column of "Line Number". The line number is obviously supposed to be starting from 1 for every new header level thing and the lines cancelled should retain their line numbering i.e. they should not be disturbed in anycase. Can somebody help me how to keep it auto ?

kindly help this.

Regards
Shabir
Re: auto_line_numbering_mechanism [message #596227 is a reply to message #596224] Thu, 19 September 2013 03:43 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How do you set these "line numbers"? Do they exist at the moment, or do you need to add them? Are they supposed to only be seen in a form, or also stored in a table?

If "deleting" actually sets some flag to "cancelled", what does it have to do with a line number?
Re: auto_line_numbering_mechanism [message #596229 is a reply to message #596227] Thu, 19 September 2013 04:47 Go to previous messageGo to next message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
Hi Littlefoot,

I have designed the form, now I want to embed this functionality of auto-numbering. This numbering should be reset for each of the new set of header info i.e. for each of new RFN, a number of lines may exist and surely I would like to save it in the database.

Your assumption is absolutely correct. I set cancelled flag to "Y" upon line deletion, in that case numbering should remain intact only it should not be revealed in the form. I would be showing them in my report.

Attached find the screen shot of my form. "RFN.jpg"

thank you in advance Smile
  • Attachment: RFN.JPG
    (Size: 90.86KB, Downloaded 699 times)
Re: auto_line_numbering_mechanism [message #596230 is a reply to message #596229] Thu, 19 September 2013 05:08 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why is that "line number" important? Is it because of sorting?

I'd suggest you to use an ordinary Oracle sequence (you'd enter its value within the database trigger or setting item's "Initial value" property or use WHEN-NEW-ITEM-INSTANCE trigger or ... pick one of various solutions) which would certainly maintain uniqueness and sort order. In other words, don't store 1, 2, 3, ... for every header - store sequence.nextval (which might be 1, 2, 3, ..., 1000, millions ...).

In a form (as well as a report), it is easy to display line numbers. In a form, you'd use :SYSTEM.TRIGGER_RECORD. In a report, you'd use a summary column or ROWNUM pseudocolumn or ROW_NUMBER analytic function (partitioned on header info ordered by the sequence number).

[Updated on: Thu, 19 September 2013 05:08]

Report message to a moderator

Re: auto_line_numbering_mechanism [message #596233 is a reply to message #596230] Thu, 19 September 2013 05:59 Go to previous messageGo to next message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
You'd may be have an idea of "Requisitions" in ERP. I want to mimic that functionality. For uniqueness I already have a column of "ID" running on a sequence. Line Number keeps track of active and inactive records. Lines get inactive if they are rejected in a workflow hierarchy.

I already used :SYSTEM.TRIGGER_RECORD for auto line numbering and it works very well, except when inactive lines are hidden, line numbers gets affected.

Please suggest something more...

Regards
Re: auto_line_numbering_mechanism [message #596323 is a reply to message #596233] Fri, 20 September 2013 07:06 Go to previous message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
can somebody help me in this regard, since i have to meet some timelines for my project.

Thanking in anticipation.
Previous Topic: ORA- 01017 in Oracle Forms
Next Topic: exceptions_in_summary_item
Goto Forum:
  


Current Time: Mon Jul 01 11:01:50 CDT 2024