12 Replies Latest reply: Apr 24, 2012 1:29 AM by Amatu Allah Neveen Ebrahim RSS

    how to enforce user enter a data in a block from another block?

    Selim_Rahman
      My form version is 6i.

      i have a form with 3 block
      block A,B and C. A is master and B is his detail and C is details of block B.
      My requirement is, when user entered data in block B then he should enter at least one data in block C, corresponding of that record of block B. Otherwise data wouldn't save at block B.

      How can i achieve this ?

      Any help will highly appreciated.
        • 1. Re: how to enforce user enter a data in a block from another block?
          DanielB
          you need to have a requiered field (one or more) in block C
          then you need to navigate to this block from B

          you have a lot of posibilities

          the user go to block A
          the user go to block C
          the user go to block B but to other record

          you can have a field on block B that you mark if have a child and check it on when-new-block-instance for block B if the user go to C you can accept this navigation, and on pst-record of B to control that the current item of record is setted
          • 2. Re: how to enforce user enter a data in a block from another block?
            DanielB
            other form is check it to the commit

            on the key-commit trigger use a post; built -in and after check that all of parent of B have C child
            • 3. Re: how to enforce user enter a data in a block from another block?
              Selim_Rahman
              Thanks for your quick reply.
              DanielB wrote:
              you need to have a requiered field (one or more) in block C
              yes i have a required field in block C.
              then you need to navigate to this block from B
              the last item of block B autometically sent cursor to block C
              But user can easily back to next record of block B without entering data at block C.

              I need, user must enter data in block C of current B block record, otherwise cursor doesn't go any other record of block B or Block A.

              Hope u understand.
              • 4. Re: how to enforce user enter a data in a block from another block?
                Amatu Allah Neveen Ebrahim
                Hi
                I need, user must enter data in block C of current B block record, otherwise cursor doesn't go any other record of block B or Block A.
                It's not quite clear this point ; current B block record or current c block record c

                What i suppose u do want is user must enter data in block C and u have to prevent him from navigation to any other block if data in this record block C is Not Entered So pls Follow...

                In Post-Block Trigger of block C Or In When-Validate_Record Trigger
                 
                
                IF  :BLOCK_C.Item_name IS NULL OR ......  THEN 
                MESSAGE ('Pls Enter Data');
                PAUSE;
                RAISE FORM_TRIGGER_FAILURE;
                Hope this helps...

                Regards,

                Amatu Allah
                • 5. Re: how to enforce user enter a data in a block from another block?
                  Selim_Rahman
                  thanks Amatu Allah for your reply.
                  I need, user must enter data in block C of current B block record, otherwise cursor doesn't go any other record of block B or Block A.
                  It's not quite clear this point ; current B block record or current c block record c
                  it's current B block record.
                  Again i say, if user enter data in B block then he must enter data in C block for this record. That means if you enter data in first record of Block B then you cannot go 2nd record of Block B without entering data in block C for first record of Block B.

                  Hope u understand.
                  • 6. Re: how to enforce user enter a data in a block from another block?
                    Amatu Allah Neveen Ebrahim
                    Simply make Block B Form Block Not Multi-Records i think... and change the Property of Navigation to Change Record

                    If it is necessary 2 use Multi-Line use in Post-Record
                    Go_Block('C');
                    Go_item('');
                    Hope this helps...

                    Regards,

                    Amatu Allah
                    • 7. Re: how to enforce user enter a data in a block from another block?
                      Selim_Rahman
                      Thanks for your reply.
                      Amatu Allah wrote:
                      Simply make Block B Form Block Not Multi-Records i think... and change the Property of Navigation to Change Record
                      It's not possible to make block B as form like. It must me tabular. and Block C also tabular.

                      Here is a snapshot.. http://www.flickr.com/photos/68110334@N02/7103011355/in/photostream

                      Again my requirement is , user don't mode from current B block record if he/she didn't insert at Block C corresponding of Block B's record.

                      Hope understand..
                      • 8. Re: how to enforce user enter a data in a block from another block?
                        Amatu Allah Neveen Ebrahim
                        user don't mode from current B block record if he/she didn't insert at Block C corresponding of Block B's record.
                        confusing Word i assumed user has to enter in A , B then Lastly C

                        But ur Phrase Says as if A ,C and Lastly B as u mentioned;user don't move from current B block record if he/she didn't insert at Block C corresponding of Block B's record.; no ?

                        If i was right then i wonder why don't u put c after A and B is the Last which is waiting from the user input in C Block.

                        Any way whatever the arrangement is i will re mentioned pls use Post-Record Trigger in whatever block u want to move using

                        GO_BLOCK();
                        GO_ITEM()
                        Then use the If Statment i gave 2 u and Raise To Freeze the user from Moving in Whatever
                        We just give u ideas u co-ordinate & apply them the Way u Want &the Place u Want.


                        Hope this helps...

                        Regards,

                        Amatu Allah
                        • 9. Re: how to enforce user enter a data in a block from another block?
                          Selim_Rahman
                          Thanks for reply.
                          confusing Word i assumed user has to enter in A , B then Lastly C
                          Yes. first input in A then B then C. B is detail of A and C is details of B. no confusing.
                          But ur Phrase Says as if A ,C and Lastly B as u mentioned;user don't move from current B block record if he/she didn't insert at Block C corresponding of Block B's record.; no ?
                          Where i said it ?
                          If i was right then i wonder why don't u put c after A and B is the Last which is waiting from the user input in C Block.
                          it's not possible, i already said.
                          Any way whatever the arrangement is i will re mentioned pls use Post-Record Trigger in whatever block u want to move using
                          didn't work in my case.
                          • 10. Re: how to enforce user enter a data in a block from another block?
                            Amatu Allah Neveen Ebrahim
                            Well Selim, it's more clarified
                            didn't work in my case.
                            Can u post the code u used in Post-record Trigger and which block u used it ?

                            2. A Different idea creating a button in the end of Block B Record after the last item navigable by user put the last code Go_... Then Raise if not......
                            3.Just a Guess Pls use Post-Text-Item of the last item navigable by user at Block B and put the last code Go_... Then Raise if not...

                            Let's see what's up?!

                            pls specify why it's not working share us the code u use pls...

                            Regards,

                            Amatu Allah
                            • 11. Re: how to enforce user enter a data in a block from another block?
                              Selim_Rahman
                              Thanks Amatu Allah
                              Well Selim, it's more clarified
                              Can u post the code u used in Post-record Trigger and which block u used it ?
                              Post-Record isn't possible. And i need to write code at block B. Because if the user want to go previous record or next record at block B from present record of block B and associate detail record of Block C is blank he should warned.

                              I try following code at pre-reocrd trigger.
                                        IF :APPOINTMENT_DTL.AD_ID IS NOT NULL THEN     --item of block B
                                             IF :APPOINTMENT_SCHEDULE.TXT_SCHEDULE IS NULL THEN  -- item of block C
                                                  MESSAGE('Please select a schedule.');
                                                  MESSAGE('Please select a schedule.');
                                                  raise form_trigger_failure;
                              end if;
                              end if;
                              code doesn't work..

                              Edited by: Selim_Rahman on Apr 23, 2012 6:01 AM
                              • 12. Re: how to enforce user enter a data in a block from another block?
                                Amatu Allah Neveen Ebrahim
                                Hi Selim

                                pls try it with The WHEN-VALIDATE-RECORD-triggeer?

                                have u tried 2 check the status of the block or record before navigating ?

                                In Post-Record or In WHEN-VALIDATE-RECORD-trigger pls use this validates the current Block of B WHERE IS the Navigation Commands i told u to use....?
                                Go_Block('C');
                                GO_ITEM('THE ITEM_NAME OF block c'); -HICH IS Required input item in Block C
                                Pls Don't wait for the Forms 2 Do Navigation to Block C implicitly Neither the Trigger Type u use or the Commands u write ...

                                Will Do What u r thinking or Suppose u want to do but the problem is that the trigger is not firing ...!!!

                                 
                                
                                --In Post Record or Post-Block Trigger 
                                
                                IF :SYSTEM.RECORD_STATUS IS "INSERT" THEN
                                
                                --do the navigation to C data block
                                
                                GO_BLOCK...
                                GO_ITEM...
                                
                                END IF;
                                -- Then -- Pls Use the Correct Validation s IN C Block Level Using WHEN-VALIDATE-RECORD Trigger to Validate ---
                                 
                                
                                IF :SYSTEM.RECORD_STATUS IS "INSERT" THEN
                                
                                IF :APPOINTMENT_SCHEDULE.TXT_SCHEDULE IS NULL THEN  -- item of block C
                                                    MESSAGE('Please select a schedule.');
                                                    MESSAGE('Please select a schedule.');
                                                    RAISE form_trigger_failure;
                                
                                     ELSE ...
                                
                                     END IF;
                                END IF;
                                Or i better suggest u to use in Block B 's property >Navigation Style > Change data Block so this way u enforce the user after entering data from block B not to go to the NEXT_RECORD but to the NEXT DATA BLOCK...

                                Hope it helps...

                                Regards,

                                Amatu Allah

                                Edited by: Amatu Allah on Apr 23, 2012 11:28 PM