Home » Developer & Programmer » Forms » Forms 9i Calendar problem (insert behaviour?)
Forms 9i Calendar problem (insert behaviour?) [message #142910] Tue, 18 October 2005 06:22 Go to next message
MrDeveloper
Messages: 4
Registered: October 2005
Junior Member
Hi,
I have a row of text-boxes in a form linked to columns in the database. One of the text-boxes uses a calendar pop-up (displayed by clicking on a button associated with that text-box) to add in a chosen date.

I can enter a row of data to all the text-boxes without a problem, but after saving the record and going back into the form to update the value in the date text-box, the calendar button seems to instigate an 'insert' rather than an 'update' behaviour? Manually typing in a new date into the text-box behaves like an update, which is fine, but the calendar seems to 'insert' a new date.

In normal circumstances this is not a problem, but there is alot of code which detects when an insert takes place and processes the data as a result, so I need to somehow get the calendar to put a date value in as if it were being typed in manually to avoid this trigger setting off.

Can this be done? Or is there a work-around? Any help/advice much appreciated.

Many thanks,
MrD
Re: Forms 9i Calendar problem (insert behaviour?) [message #142932 is a reply to message #142910] Tue, 18 October 2005 07:52 Go to previous messageGo to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
Questions:

Please provide version of Forms, version of RDBMS and whether you are using the calander object from calendar.ppl or calendarWidget Javabean

also
"...avoid this trigger setting off"


which trigger?
Re: Forms 9i Calendar problem (insert behaviour?) [message #142959 is a reply to message #142932] Tue, 18 October 2005 08:34 Go to previous messageGo to next message
MrDeveloper
Messages: 4
Registered: October 2005
Junior Member
Hi,
I am using Forms v9.0.2.9.0 with a 9.2.0.1 back-end.

The trigger is WHEN-DATABASE-RECORD, and detects when there is an INSERT and re-calculates the value of a field as follows:

IF SYSTEM.RECORD_STATUS = 'INSERT'
:project.reference_nos := NVL(:project.max_item,0) +1;
:project.total_rows := project.total_rows +1;
END IF

When adding a new row, the reference_nos column automatically increments as you add the data in as it should. However, for some reason, when you go back to change the date in the saved row, this trigger seems to increment the existing reference_nos of that row yet again. No other columns do this, and typing the date into the text-box manually does not increment it either - just the effect of using the calendar.

Very confusing..
MrD
Re: Forms 9i Calendar problem (insert behaviour?) [message #142961 is a reply to message #142959] Tue, 18 October 2005 08:38 Go to previous messageGo to next message
MrDeveloper
Messages: 4
Registered: October 2005
Junior Member
Oh, and I'm using the calendar object library (PLL etc) that has been attached to the form.

If it helps, the data block holding the text-boxes has been set to multiple - so it can display multiple rows from the table in one go stacked on top of one another with a vertical scroll-bar.

Placing my cursor in the correct date text-box will direct the calendar to place the chosen value into that particular row in the database etc.

MrD
Re: Forms 9i Calendar problem (insert behaviour?) [message #142997 is a reply to message #142961] Tue, 18 October 2005 13:31 Go to previous messageGo to next message
MrDeveloper
Messages: 4
Registered: October 2005
Junior Member
Please ignore -
I did some further investigation and realised that I could not avoid how the calendar operates, but I could change how the trigger deals with it. Modified the code to detect a change by the calendar and prevented the insert operation from functioning.

Thank you for the responses though, much appreciated.

Regards,
MrD
Re: Forms 9i Calendar problem (insert behaviour?) [message #143017 is a reply to message #142997] Tue, 18 October 2005 14:44 Go to previous message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
MrD

Why not post your trigger code so that others in the future will benefit from your hard work?

Thanks in advance.

Barry
Previous Topic: how to display values in list item from a querry?
Next Topic: There was a failure in the forms server during startup & forms error - frm-92101 (merged)
Goto Forum:
  


Current Time: Fri Sep 20 03:38:05 CDT 2024