14 Replies Latest reply: Feb 11, 2013 11:23 AM by Andreas Weiden RSS

    Regarding Create Record in Oracle forms

    848964
      Hi,

      I am having a form in which I had two sections, master and detail. Master section has a field in which I select week range like 01-FEB-2012-07-FEB-2012.

      Based upon this I am populating with the help of CREATE_RECORD(writted in when new block of detail) , 7 rows in the detailed section,
      01-FEB-2012
      02-
      03-

      till 07-FEB-2012.

      There are other columns in the detail section beside this date field. Now at a stage when nothing is saved, I can go in the master block and change the week rangeb from LOV and accordingly the date field in the detail section gets populated with new 7 days/rows. (Its happening as the system.record_status = INSERT).

      Now what I need is when I select the date range in master, 7 days as usual gets populated in detail section. Now I save and then I try to change the lov for the date range in master i doesn't allow me to change .(presently the system.record_status = QUERY) although I have taken 3 modes (NEW , INSERT & QUERY in the when new block code.

      I am now not able to sure if at all what I want is feasible or not considering the mode when its QUERY. I tried doing some r&d but not of much help. Can anyone plz advise if this is a feasible requirement or not possible as per standard method.

      Appreciate suggestions on this.

      Thanks & Regards,

      Ad
        • 1. Re: Regarding Create Record in Oracle forms
          MLBrown
          >
          Now I save and then I try to change the lov for the date range in master i doesn't allow me to change
          >

          Why doesn't it let you? Are you getting an error message? If so, what is the error?
          • 2. Re: Regarding Create Record in Oracle forms
            848964
            Hi,
            I am not getting any error. When I am trying to click on the week range LOV, its something like unaccessible. I am unable to open the list as if my clicks are not impacting.

            Regards,

            Ad
            • 3. Re: Regarding Create Record in Oracle forms
              MLBrown
              Okay - Maybe you couild add logic to your save button that will issue a CLEAR_FORM; after the save is committed and see if it will work.
              • 4. Re: Regarding Create Record in Oracle forms
                848964
                Hi,

                Thanks for your suggestion. There is no custom save button explicitly in the form. I use CRTL-S or the seeded save button to save.
                Are u suggesting the form clear to applied in the ON_COMMIT trigger at form level.

                Even it works, I believe once I save form will be cleared immediately which also would not be desirable as after save immediately data should not get disappeared.
                But I can definitely give it a try.

                Thanks,
                Ad
                • 5. Re: Regarding Create Record in Oracle forms
                  Ahamed Rafeeque
                  Dear Friend,

                  Can you please tell me what you actually wants to do. I will suggest you the best way to do that.

                  Regards
                  Ahamed Rafeeque Cherkala

                  Edited by: Ahamed Rafeeque on Feb 10, 2013 3:09 AM
                  • 6. Re: Regarding Create Record in Oracle forms
                    421131
                    Write a Key-Commit - Trigger. Ctrl S will execute the Key-Commit-Code. The Key-Commit-Trigger must contain a commit_form. If you create a push-button for commit-processing, just write Do_Key('commit_form') in your when-button-pressed trigger. This will start Key-Commit.

                    In general I don't understand what you are trying to do in your detail-block. The master seems to be a control-block without a table, but what are you doing in the detail-block?
                    - Initialize an intervall with new records?
                    - Query all records in the intervall given by the master?
                    - are you using the database at all?

                    Kind regards
                    Wolfram
                    • 7. Re: Regarding Create Record in Oracle forms
                      848964
                      Hi Ahmed,

                      I have a form in which I have master and detail form.

                      I have one Item in the master block: 'Week". An LOV is attached where I am bringing a list of week ranges: lie "01-JAN-2013 - 07-JAN-2013" , "08-JAN-2013 - 14-JAN-2013" and so on.

                      Now I select, say the week as "01-JAN-2013 - 07-JAN-2013".

                      In the 7 rows detail block, create_record logic is written in when new block(detail) , which populates 2 fields Day &Date field in detail block based upon week range entered in Master e.g.

                      DAY DATE
                      SUN 01-JAN-2013
                      MON 02-JAN-2013
                      ............................
                      SAT 07-JAN-2013


                      Once 7 dates populated, then if I again go back to master and change the week range, the day/dates in the detail will also get changed. NOW THIS IS HAPPENING IF NOTHING WAS SAVED.

                      IF I SAVE FIRST TIME, Then if I try to change the LOV for the week range lov, its simple not allowing me to do so. When I try to click on the LOV, I cannot change anything.

                      So conclusion is if nothing is saved, I can change the week LOV as many times as possible and if saved, I am not able to do any change in the week range LOV.

                      When transactions are not saved and are only entered, record_status = INSERT and when saved, record_status = QUERY. I have incorporated both in my when new block code still its not working for saved ones.

                      Regds Ad
                      • 8. Re: Regarding Create Record in Oracle forms
                        Ahamed Rafeeque
                        Dear friend,

                        I don't know what you actually you can replace LOV with list item as below and also follow the logic below. It will work for you.

                        List Item name "WEEK"
                        List Element List Item Value
                        ------------ ---------------
                        01-JAN-2013 - 07-JAN-2013 '01-JAN-13' AND '07-JAN-13'
                        08-JAN-2013 - 14-JAN-2013 '08-JAN-2013' AND '14-JAN-2013'

                        and so on

                        And put code below in when list changed event of the list item

                        GO_BLOCK('Your Block Name'); -- Detail block name
                        SET_BLOCK_PROPERTY('Your Block Name',DEFAULT_WHERE,'MDate BETWEEN '||:WEEK);
                        --MDate is the column name which you want to filter
                        CLEAR_BLOCK(NO_VALIDATE);
                        EXECUTE_QUERY;

                        This method is easy and fast.

                        Edited by: Ahamed Rafeeque on Feb 10, 2013 5:39 AM
                        • 9. Re: Regarding Create Record in Oracle forms
                          848964
                          Hi Ahamed,

                          Actually where clause is not applicable in my requirement. I am not finding anything in the detail block. I will be creating new records based upon the week LOV value entered.

                          The form is used to create employee's weekly shift. So if I want to create shift for an employee say XYZ for the week 01-JAN-2013 - 07-JAN-2013. I will select the value as 01-JAN-2013 - 07-JAN-2013 from the LOV in master block.

                          Then I move to the detail block, and as a result of the code written in when new block of detail,

                          the column DAY & DATE will be autopopulated for the 7 rows:

                          DAY DATE
                          -----------------------
                          SUN 01-JAN-2013
                          MON 02-JAN-2013
                          TUE 03-JAN-2013
                          and so on ........till
                          SAT 07-JAN-2013

                          Now there are other columns beside DAY & DATE like shift name.

                          I provide a shift name on each of the 7 days and I save it.

                          Now my screen in master wil look like:

                          Employee : XYZ Week: 01-JAN-2013 - 07-JAN-2013


                          Detail screen will look like:

                          DAY DATE SHIFT and there are other columns
                          ------------------------------------------------------------------------------------------------------------
                          SUN 01-JAN-2013 Morning
                          MON 02-JAN-2013 Morning
                          TUE 03-JAN-2013 ..........
                          and so on ........till ...........
                          SAT 07-JAN-2013 Night

                          At this stage if I go to the master screen and try to change the LOV value to say 08-JAN-2013 - 15-JAN-2013. Then I expect that detail screen will be autopopulated with new values :

                          DAY DATE
                          -----------------------
                          SUN 08-JAN-2013
                          MON 09-JAN-2013
                          TUE 10-JAN-2013
                          and so on ........till
                          SAT 15-JAN-2013


                          This thing is happening at the unsaved stage i.e if not saved and I change the LOV value in master multiple times, the detail will be autopopulated everytime replacing the previous 7 rows.

                          But not working once SAVED i.e its not allowing to change value in the week LOV in master. I am able to click but it doesn't opens up the list.
                          Hope I am able to explain the issue.

                          Regards,

                          Alok Datta
                          • 10. Re: Regarding Create Record in Oracle forms
                            Amatu Allah Neveen Ebrahim
                            Hi
                            if not saving then u have an error not displayed related to the db from menu help display error

                            Amatu Allah
                            • 11. Re: Regarding Create Record in Oracle forms
                              Ahamed Rafeeque
                              Its OK friend, Can you tried same thing with list item in place of LOV. Just try that one, I am sure it will work for you.

                              Regards
                              Ahamed Rafeeque Cherkala
                              • 12. Re: Regarding Create Record in Oracle forms
                                848964
                                Hi Ahamed,

                                I observed something in the master block. I am unable to change whatever LOV's are there in Master block. Detail block I am able to change. Master is based on view and details is based on table.

                                Issue : Immediately after save, when I try to change LOV value in master, it doesn't allow me to change as discussed

                                When I close the form and query the same data, then I am able to change LOV values in master. This is surprising i.e immdiately after save it is not allowing but after querying and then chaning LOV , its allowing.

                                Regards,

                                Ad
                                • 13. Re: Regarding Create Record in Oracle forms
                                  Ahamed Rafeeque
                                  Please try to following command immediately after saving (commit_form) the data.
                                  Go_Block('DETAIL');
                                  CLEAR_BLOCK(NO_VALIDATE);
                                  GO_BLOCK('MASTER');
                                  CLEAR_BLOCK(NO_VALIDATE);

                                  May be this will help you.

                                  Regards
                                  Ahamed Rafeeque Cherkala.
                                  • 14. Re: Regarding Create Record in Oracle forms
                                    Andreas Weiden
                                    If you are not able to change a record after saving there might be the error "Record has been changed by another user" which will be shown in the console-window. DO you have the console-window set? Do you see any error there?