Zoom Feature with Custom.pll or Form Personalization

什么Zoom功能:通过客户化,用户在点击Zoom按钮后,可以从一个Form跳转到另外一个Form上。

比如销售订单,输入物料后,想看下物料的库存情况,可以把焦点放在到物料上,然后点击Zoom按钮,Workbench的Form被调用起来。

有两种方法可以实现zoom功能:第一种是通过custom.pll,还有一种是通过Form Personalization


1. Custom.pll

FUNCTION ZOOM_AVAILABLE
RETURN BOOLEAN IS
  form_name VARCHAR2 (30) := NAME_IN ('system.current_form');
  block_name VARCHAR2 (30) := NAME_IN ('system.cursor_block');
BEGIN
  if (form_name = 'OEXOEORD' AND block_name = 'LINE') then
    RETURN TRUE;
  else
    RETURN FALSE;
  end if;
END zoom_available;


PROCEDURE EVENT(EVENT_NAME VARCHAR2)
IS

param_to_pass1 VARCHAR2 (255);
b varchar2(20);

BEGIN
  IF (EVENT_NAME = 'ZOOM') THEN
    IF (FORM_NAME = 'OEXOEORD' AND BLOCK_NAME = 'LINE') THEN
      param_to_pass1 := NAME_IN ('LINE.ORDERED_ITEM_DSP');
      fnd_function.EXECUTE (function_name => 'INV_INVMATWB',
      open_flag => 'Y',
      session_flag => 'Y',
      other_params => 'ITEMS="'
      || param_to_pass1
      || '"' );
    END IF;
  END IF;
  
  IF (EVENT_NAME = 'WHEN-NEW-RECORD-INSTANCE') THEN
    IF (FORM_NAME = 'INVMATWB' AND BLOCK_NAME = 'MATERIAL_QF') THEN
      b := FND_PROFILE.VALUE ('user_name');
      fnd_message.set_string (NAME_IN ('parameter.ITEMS')
      || 'is entered by user'
      || b);
      
      fnd_message.show ();
      GO_ITEM ('MATERIAL_QF.ITEM');
      COPY (NAME_IN ('parameter.ITEMS'), ('MATERIAL_QF.ITEM'));
      VALIDATE (item_scope);
      
    END IF;
END EVENT;

Oracle也提供了一个广为流传的例子:link


2.Form Personalization

Form Personalization也可以实现同样的Zoom功能,相比Custom.pll的方式更快,而其几乎不需要写代码。

转载一个例子,原链接:http://erpschools.com/articles/forms-personalization-tutorial

In this tutorial we will zoom from Order Organizer form to Shipping transactions form and also populate the order number dynamically in destination form.

Know the following things before you start

  • Know the names of source form and destination form
  • If you need to populate the data dynamically know what fields that you need to populate.
  • Global Variables: These variables can be initialized in any form and can be used in any form all over the applications
  • Trigger & Action: trigger is an event and action is operation/execution that we do. When an event occurs we do operation/execution

Source form: Order Organizer form ( )

Destination form: Shipping transactions form (WSHFSTRX)

Source field: Order number ()

Destination field1: Order number low (QM_DLVB.DLVB_SOURCE_HEADER_NUMBER_LO)

Destination field2: Order number high (QM_DLVB.DLVB_SOURCE_HEADER_NUMBER_HI)

Destination field3: Line Status (QM_DLVB.DLVB_LINE_RELEASED)

Process flow:

  • Initialize the menu/icon in source form
  • Initialize the global variables
  • When the menu/icon is clicked copy the order number from source form filed to global variable and then launch the destination form
  • In the destination form copy the value from global variable to destination form field.

Initialize the menu/icon in source form

Navigation: Order Management Super User Orders, Returns Order Organizer


Navigation: Help Diagnostics Custom Code Personalize

Follow the screenshots







Personalization in Destination Form











你可能感兴趣的:(Zoom Feature with Custom.pll or Form Personalization)