Wednesday 20 November 2013

Cancal PO based on Agent in form personalization.

Particular customer can not cancel the purchase order and Disable the button.

Step 1:


 Step 2:






Step 3: Disable this button.



Personalization part:



Step1

Step 2:
 Write the condition

Coding :
:HEADERS_FOLDER.AGENT_NAME  NOT IN
(SELECT DESCRIPTION
FROM FND_LOOKUP_VALUES FLV1
WHERE FLV1.LOOKUP_TYPE = 'LOOKUP TYPE'
AND FLV1.LOOKUP_CODE = 'LOOKUP CODE'
AND UPPER(FLV1.TAG)=UPPER(FND_PROFILE.VALUE('RESP_NAME')))
AND :HEADERS_FOLDER.AGENT_NAME  IN
(SELECT DESCRIPTION
FROM FND_LOOKUP_VALUES FLV
WHERE FLV.LOOKUP_TYPE = 'LOOKUP TYPE'
AND FLV.LOOKUP_CODE = 'LOOKUP CODE')
AND COMMON_UTILS_PKG.GET_SL(FND_PROFILE.VALUE('ORG_ID')) 

Note GET_SL:
 =========
      FUNCTION get_sl (
      p_org_id   IN   NUMBER)
      RETURN VARCHAR2 AS

         lv_service_line VARCHAR2(10);

      BEGIN

              SELECT ffv.flex_value_meaning
                 INTO lv_service_line
                FROM fnd_flex_value_sets ffvs
                        ,fnd_flex_values_vl ffv
                        ,hr_operating_units hou
              WHERE  1 = 1
              AND    flex_value_set_name = 'XX_OPERATING_UNIT'
              AND    ffv.flex_value_set_id = ffvs.flex_value_set_id
              AND    ffv.description = hou.short_code
              AND    enabled_flag = 'Y'
              AND    TRUNC (SYSDATE) BETWEEN TRUNC (NVL (start_date_active, SYSDATE)) AND TRUNC (NVL (end_date_active, SYSDATE))
              AND    HOU.organization_id = p_org_id;

              RETURN lv_service_line;

      EXCEPTION WHEN OTHERS THEN

          RETURN '';

      END  get_sl;

Step 3:
Action button show the message.



Step 4:
Disable the button --> PO_DOCON_CONTROL.OK_BUTTON




No comments:

Post a Comment