DFF Requiremnt and Question

Sandy4312

    MiscTrans1.jpeg

     

    MiscTrans.jpeg

     

    Hello Gurus - When user selected "Miscellaneous receipt" and when they select particular Reason ( Only Contractor spare parts ) ,This field should be a required field only when the reason ‘Contractor Spare Parts’ has been selected.for Other  Misc Trans/Reason I want to leave this filed as normal.Can anyone help me how to achieve this?

     

    MiscTrans3.jpeg

      • 1. Re: DFF Requiremnt and Question
        Bashar.

        Hi,

         

        You need to customize the custom.pll library. Check the following discussion for an example on a similar requirement:

         

        [Solved] How to make a DFF segment 'Read-Only' using Form Personalization?

         

        Regards,

        Bashar

        1 位用户发现它有用
        • 2. Re: DFF Requiremnt and Question
          Sandy4312

          Without Doing custom.pll there is no other workaround?

          • 3. Re: DFF Requiremnt and Question
            Bashar.

            Hi again!

             

            You may refer to the following documentation link for more information on the procedure used in the link I posted before:

             

            https://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T457085.htm

             

            Regards,

            Bashar

            1 位用户发现它有用
            • 4. Re: DFF Requiremnt and Question
              Bashar.

              Actually there is one more option!

              Develop a database trigger that throws an error if the DFF segment has a value for that specific reason.

               

              Regards,

              Bashar

              • 5. Re: DFF Requiremnt and Question
                Sandy4312

                Hi Bashar - "Develop a database trigger that throws an error if the DFF segment has a value for that specific reason"

                I'm Not clear .. can you give you me steps pls?

                • 6. Re: DFF Requiremnt and Question
                  Bashar.

                  Hi,

                   

                  You should have database development experience to do this.

                  Basically you should do the following:

                   

                  1. Make this DFF segment not required.
                  2. Create a custom trigger on the table used by the block. It should be "before insert" and "before update".
                  3. Write a code to check the reason.
                  4. If it is the reason you want, check if there is a value in the DFF segment and raise an error if there is any.
                  5. For all other reasons, raise an error in that DFF segment has no value.

                   

                  Regards,

                  Bashar

                  1 位用户发现它有用
                  • 7. Re: DFF Requiremnt and Question
                    John_K

                    You might be able to achieve something using forms personalization with the when-validate-record trigger.

                    • 8. Re: DFF Requiremnt and Question
                      Sandy4312

                      Really ? If Yes.. Can you give me brief steps without touching the Custom.PLL.

                      It will be really helpful.

                      • 9. Re: DFF Requiremnt and Question
                        Sandy4312

                        I tried with FND_DESCR_FLEX.UPDATE_DEFINITION concept ,It doesn't workout for my particular requirement,So I make it very simple using CUSTOM.PLL code as per below. and See my Final Screen Shot.

                        I just want to share so other users get benefited.

                         

                         

                        -- Add this piece of code in CUSTOM.PLL  in  ( PROCEDURE event (event_name VARCHAR2)

                         

                              form_name              VARCHAR2 (30) := NAME_IN ('system.current_form');

                              block_name             VARCHAR2 (30) := NAME_IN ('system.cursor_block');

                              param_to_pass2       VARCHAR2 (255);

                              L_TRANSACTION_TYPE   VARCHAR2 (255);

                              L_ATTRIBUTE4         VARCHAR2 (255);

                         

                        IF event_name = 'WHEN-VALIDATE-RECORD'

                              THEN

                                  --- Debug Messages for Testing Purpose

                                 /*IF form_name = 'INVTTMTX' AND block_name = 'MISC_TRX'

                                 THEN

                                -- fnd_message.set_string ('Header.... ');

                                 --  fnd_message.show ();

                                    l_TRANSACTION_TYPE := NAME_IN ('MISC_TRX.TRANSACTION_TYPE');

                                 END IF;*/

                         

                         

                                 IF (form_name = 'INVTTMTX' AND block_name = 'MTL_TRX_LINE')

                                 THEN

                                    --- Debug Messages for Testing Purpose --

                                    -- fnd_message.set_string ('lines.... ');

                                    --  fnd_message.show ();

                                    param_to_pass2 := NAME_IN ('MTL_TRX_LINE.reason');

                                    l_TRANSACTION_TYPE := NAME_IN ('MISC_TRX.transaction_type');

                         

                         

                                    IF  param_to_pass2 = 'CONTRACTOR SPARE PARTS'  AND l_TRANSACTION_TYPE = 'Miscellaneous receipt'

                                    THEN

                                       L_ATTRIBUTE4 := NAME_IN ('MTL_TRX_LINE.ATTRIBUTE4');

                         

                         

                                       IF L_ATTRIBUTE4 IS NULL

                                       THEN

                                          fnd_message.set_string ('When you selected "CONTRACTOR SPARE PARTS" Transaction Reason Code,You need to enter Project Number in DFF LOV is Mandatory ');

                                          fnd_message.show ();

                                          RAISE form_trigger_failure;

                                       END IF;

                                    END IF;

                                 END IF;

                              END IF;

                         

                         

                        --- Result

                         

                        When we get this Message Users cannot "Save" until they enter DFF value.

                         

                        Message.jpeg

                         

                        Thanks Everyone.