忙里偷闲

很多事情很多心情写了也就记下了; 不写,以后可能就忘了.
个人资料
正文

Workflow Not Started/Notification Not Sent For Invoice Holds

(2013-03-22 08:14:09) 下一个

Module: Oracle Payables

Symptoms: AP Workflow not started for invoice price variance hold. The invoice approval history is empty and the notification is not sent out to the approver/Buyer

Note: The symptoms may happen to other hold types when the same setup.

Cause: "Manual Release Allowed" options in the Hold Setup for price variance hold was not Enabled.

Reason: Holds resolution workflow is only initiated during invoice validation with both conditions: 
      1) The Initiate Workflow option is selected for hold type; 
      2) ‘Manual Release Allowed’ option is checked.

Solution: 
      Payables Responsibility > Setup : Invoice >Hold and Release Names
      Query for the Hold: example: Price
      Enable "Manual Release Allowed" options

Challenges: 
      The price hold (or other holds) is not supposed to be manually released. By selecting ‘Manual Release Allowed’,  manual release is open.

      Luckily we have the rule that for all those holds supposed to send out notifications by initiating workflow, manual release is not allowed.

Workaround: 
       A form personalization is needed to turn off release button and manual release option in action window. 
      1) Make ‘Release button’ disabled.
      Condition:
          Trigger event: WHEN-NEW-RECORD-INSTANCE
          Trigger Object: AP_HOLDS
          Condition: XX_5011_AP_HOLD_INV_NTF_PKG.XX_Manual_Release_Not_Allowed(:AP_HOLDS.HOLD_NAME) = 'Y' 
      Actions:
          Type: Property
          Object Type: Item
          Target Object: AP_HOLDS_CONTROL.ACTION_BUTTON
          Property Name: ENABLED
          Value: FALSE

      2) Make manual release option disable in action window. 
      Condition:
          Trigger event: WHEN-NEW-RECORD-INSTANCE
          Trigger Object: AP_HOLDS
          Condition: XX_5011_AP_HOLD_INV_NTF_PKG.XX_Manual_Release_Not_Allowed(:AP_HOLDS.HOLD_NAME) = 'Y'
      Actions: 1
          Type: Property
          Object Type: Item
          Target Object: AP_HOLDS.RELEASE_NAME 
          Property Name: ENTERABLE (APPLICATIONS COVER)
          Value: FALSE
      Actions: 2
          Type: Property
          Object Type: Item
          Target Object: AP_HOLDS.RELEASE_REASON 
          Property Name: ENTERABLE (APPLICATIONS COVER)
          Value: FALSE

The package to be called:

XX_5011_AP_HOLD_INV_NTF_PKG.XX_Manual_Release_Not_Allowed(:AP_HOLDS.HOLD_NAME)

Logic: Return ‘Y’ if ‘Initiate Workflow’ option is checked.

  Function XX_Manual_Release_Not_Allowed(l_HOLD_LOOKUP_CODE in varchar2)
    RETURN varchar2 IS
    --  PRAGMA AUTONOMOUS_TRANSACTION;
    l_initiate_workflow_flag ap.ap_hold_codes.initiate_workflow_flag%type;
    --   l_user_releaseable_flag ap.ap_hold_codes.user_releaseable_flag%type;
    l_hold_id ap.ap_holds_all.hold_id%type;
    --  l_hold_lookup_code ap.ap_hold_codes.hold_lookup_code%type; 

  BEGIN
   select nvl(ahc.initiate_workflow_flag, 'N')
      INTO l_initiate_workflow_flag
      from ap.ap_hold_codes ahc, ap_lookup_codes alc
     where ahc.hold_lookup_code = alc.lookup_code
       and alc.lookup_type = 'HOLD CODE'
       and nvl(alc.displayed_field, 'X') = nvl(l_HOLD_LOOKUP_CODE, 'X');
    RETURN l_initiate_workflow_flag;

  EXCEPTION
    WHEN no_data_found THEN
      RETURN 'N';
    WHEN OTHERS THEN
      -- ROLLBACK;
      FND_FILE.PUT_LINE(FND_FILE.LOG,
                        'XX_5011_Manual_Release_Not_Allowed' || ' ' ||
                        SQLERRM || 'hold_lookup_code:' ||
                        l_hold_lookup_code);
      RAISE_APPLICATION_ERROR(-20001,
                              'XX_5011_Manual_Release_Not_Allowed' || ' ' ||
                              SQLERRM || 'hold_lookup_code:' ||
                              l_hold_lookup_code);
  END XX_Manual_Release_Not_Allowed;



[ 打印 ]
阅读 ()评论 (4)
评论
平安是福mtl 回复 悄悄话 回复五弟五哥,orange88的评论:
问候五哥和橙子~~这段时间没有来,抱歉没有招待好。你们一切都好吧。
orange88 回复 悄悄话
平安,还是很忙吧?

来看看你,道一声母亲节快乐!珍重!
五弟五哥 回复 悄悄话 平安,你这是什么啊?很专业嘛。
登录后才可评论.