Re: Help with Developer 2000 problem

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1998/01/28
Message-ID: <886003503.1182007310_at_dejanews.com>#1/1


In article <34CDF7D9.24AB2AE2_at_csc.com>,   Savithri Devaraj <sdevaraj_at_csc.com> wrote:
> We are using Oracle Developer 2000, Forms 4.5 for our
> development on a Contract here.
>
> My question is how to validate a given set of dates for
> covering a date range without overlaps or gaps.
>
> The user is allowed to add/edit multiple records on this
> form. Each record has a Sale#, a Start date and an End
> Date. This form is valid for a date range, say Plan
> Start Date and Plan End Date. The set of records the user
> enters is supposed to envelope the complete range from
> Plan Start Date to Plan End Date without overlaps.
> How do i validate the user's input for no gaps or
> overlaps, especially when all these records are still
> on the form and have not yet gone into the database?
> There doesn't seem to be any easy way of doing this with
> the Developer 2000 triggers and built-ins.
>
> For eg, if the Plan ranges between 1/1/1998 and 1/31/1999,
> and the user enters 5 records that are not sorted on
> the start date, How do i validate his input?
>
> Has any one encountered this problem before? Any help is
> appreciated.
>
> Thankyou

That's a pretty unique type of edit situation. You won't find any triggers or programming aids anywhere for this one.

You will need to do the validation from the key-commit trigger, so validation is done just prior to the commit of the data.

You will need to loop through all the rows for the dates. Create a record group to do the editing, and copy each date range to a row in the record group along with its record number from the block. Then sort the record group by starting date (you will have to write your own sort routine).

Next, cycle through the record group rows, ensuring the ending date on each row is immediately followed by the start date on the next row.

If you find an end date that has no "next day" or that "overlaps" another date, use the record number stored with the dates to go to the row in your block with that end date. Place the cursor on the date item and issue an error message.

Have fun! Steve Cosner



http://members.aol.com/stevec5088
Downloadable Quick Access utility form: Display and update any table.
-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Wed Jan 28 1998 - 00:00:00 CET

Original text of this message