This discussion is archived
2 Replies Latest reply: Nov 15, 2012 12:05 AM by Moazam Shareef RSS

How to make a filed mirror of another field

user518071 Newbie
Currently Being Moderated
Hi,
I'm working on a form in which block is based on a table.That table consists of fields like request date,refresh date etc.
"Request date" is a mirror of "refresh date" . I'm entering refresh date first.
Request date is a database item and it's required property is set to Yes.It's synchronize with item is set to refresh date.
As soon as I enter a value in refresh date,same value is displayed in request date.When I'm saving those changes,
I'm getting
ORA-1400: cannot insert null 
.

To make it work,
Do I need to change required property to NO and create when-validate-item ?

Thanks,
Kiran
  • 1. Re: How to make a filed mirror of another field
    MLBrown Journeyer
    Currently Being Moderated
    I don't even remember the last time that I used "sychronize with item" if ever, but as I was playing with it I noticed that when you entered a value for one the items that both were displayed on the canvas, but when you tried to save the record only one of them has the actual value which is why you are getting the error that you are getting.

    What I ended up doing was creating two more items in the block DISP_REQUEST_DATE and DISP_REFRESH_DATE and I displayed these on the canvas instead of REQUEST_DATE and REFRESH_DATE.

    I then added the DISP_REFRESH_DATE item to the DISP_REQUEST_DATE Synchronize with Item property.

    In order for the values to get saved to the database, I created a PRE-INSERT and PRE-UPDATE trigger with the following in both:
    :temp_table.request_date := :temp_table.disp_request_date;
    :temp_table.refresh_date := :temp_table.disp_refresh_date;
    That seems to work in the form I created trying to emulate your problem.
  • 2. Re: How to make a filed mirror of another field
    Moazam Shareef Explorer
    Currently Being Moderated
    Both Refresh Date and Request Date are in the same table? set the properties of the item where you are synchronise with item the below property should be set.

    to Synchronise Set the Data Property --> synchronise which item?

    remember both item data should be the same. (Ex: Date = Date)

    if one of your item is non database item then mirror property should be Database_item =No in database property.

    Regards

    Moazam

Legend

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