Monday 21 March 2011

Defaulting a value in Contract Lines DFF in Service Contract form.

Hi All,

Here is a topic on defaulting a value in Contract Lines DFF in Service Contract form, whenever the Ship To Account is entered with the value.
This can be achieved through the use of CUSTOM.PLL.

This is just a sample piece of code, to be added to the CUSTOM.PLL, which can modified according to the requirements.


      IF (v_form_name = 'OKSAUDET')
      THEN
         IF (v_block_name = 'OKS_LINES')
         THEN
            IF (event_name = 'WHEN-NEW-ITEM-INSTANCE')
            THEN
                IF   NAME_IN (':SYSTEM.TRIGGER_ITEM') IN
                            ('OKS_LINES.SHIP_TO_ACCOUNT',
                             'OKS_LINES.SHIP_TO_LOCATION'
                            )
                 AND NAME_IN (':SYSTEM.RECORD_STATUS') IN ('NEW', 'INSERT')
                 AND NAME_IN ('OKS_LINES.SHIP_TO_ACCOUNT') IS NOT NULL
                THEN
                
                    v_item_desc := NAME_IN (':OKS_LINES.NAME');

                    v_ship_cust_number := NAME_IN ('OKS_LINES.SHIP_TO_ACCOUNT');
                        
                    COPY (v_item_desc, 'OKS_LINES.ATTRIBUTE2');
                   -- This is the attribute where in which the value has to be populated automatically whenever the Ship to account is entered with the value.
                            
                END IF;
                     
            END IF; -- Event
         END IF;    -- Block
      END IF;       -- Form

No comments:

Post a Comment