ITPub博客

首页 > Linux操作系统 > Linux操作系统 > FND_PROFILE.VALUE

FND_PROFILE.VALUE

原创 Linux操作系统 作者:scu2005 时间:2010-01-18 11:30:44 0 删除 编辑
取得當前application_id
select FND_PROFILE.VALUE('RESP_APPL_ID') from dual
如取得不到可用fnd_form  fnd_application 來取得
取得當前 responsibility.applicationshort name
FND_PROFILE.VALUE('APPL_SHRT_NAME')
可能會不支持,此為user guid 的一個錯誤

用戶所擁有的 Responsibilty

select * from FND_USER_RESP_GROUPS;

取得當前responsibility名稱

fnd_profile.value('RESP_NAME')

fnd_profile.value('RESP_ID')

如何在窗口標題處顯示位置名稱

The following solution works:

The solution involves customization to an Oracle Application form. and library.

The form. name is “fndscsgn.fmb” and the library name is “custom.pll”.
The form. “fndscsgn.fmb” is located in apps ncaau1.0formsus and “fndscsgn.fmx” is located

in appsncafnd7.5formsus directories.The library “custom.pll” and “custom.plx”

are located in appsncaau1.0resource directory.

I)Customization to fndscsgn.fmb:
1)Save a copy of the original form. “fndscsgn.fmb” and “fndscsgn.fmx”.
2)Open the form. “fndscsgn.fmb” using Oracle forms designer.
3)Edit the program unit “START_RESP” as follows:
Original code:

-- Set window title
FND_MESSAGE.SET_NAME('FND','NAVIGATOR');
FND_MESSAGE.GET(navigator_name);
set_window_property('NAVIGATOR', TITLE, navigator_name || ' - '||
FND_PROFILE.VALUE('RESP_NAME'));

New code:

declare
lv_app_title varchar2(100);
lv_site_name varchar2(100);
begin
-- Set window title
FND_MESSAGE.SET_NAME('FND','NAVIGATOR');
FND_MESSAGE.GET(navigator_name);

IF fnd_profile.defined('SITENAME') = TRUE THEN
fnd_profile.get('SITENAME',lv_site_name);
lv_app_title := '<'||lv_site_name||'>';
END IF;
set_window_property('NAVIGATOR', TITLE, navigator_name || ' - '||
FND_PROFILE.VALUE('RESP_NAME')||' '||lv_app_title);
set_window_proper('ROOT_WINDOW',TITLE,'Toolbar'||' '||lv_app_title);
end;

4)Compile the form. and save it.
5)Generate the form. executable “fndscsgn.fmx”.
6)Copy the new form. “fndscsgn.fmb” to appsncaau1.0formsus and “fndscsgn.fmx” to appsncafnd7.5formsus
directories.

II)Customization to custom.pll:
1)Save a copy of the original library “custom.pll” and “custom.plx”.
2)Open the library “custom.pll” using Oracle forms designer.



3)Edit the “custom.style” function to include the following code:

if (upper(event_name) = 'WHEN-NEW-FORM-INSTANCE') then
return custom.after;
else
return custom.standard;
end if;

4)Edit the “custom.event” procedure to include the following code:
declare
lv_app_title VARCHAR2(100);
lv_win_title VARCHAR2(100);
lv_item_id item;
lv_canvas_name VARCHAR2(50);
lv_event_window VARCHAR2(50);
lv_site_name VARCHAR2(100);
begin
IF (upper(event_name) = 'WHEN-NEW-FORM-INSTANCE') THEN
lv_item_id := find_item(name_in('system.cursor_item'));
IF not id_null(lv_item_id) THEN
lv_canvas_name := get_item_property(lv_item_id,item_canvas);
IF lv_canvas_name IS NOT NULL THEN
lv_event_window :=
get_view_property(lv_canvas_name,window_name);
IF lv_event_window != 'ROOT_WINDOW' THEN
lv_win_title :=
get_window_property(lv_event_window,TITLE);
END IF;
END IF;
END IF;
IF fnd_profile.defined('SITENAME') = TRUE THEN
fnd_profile.get('SITENAME',lv_site_name);
lv_app_title := '<'||lv_site_name||'>';
set_window_property (lv_event_window,TITLE,lv_win_title||' '||lv_app_title);
set_window_property('ROOT_WINDOW',TITLE,'Toolbar'||' '||lv_app_title);
END IF;
END IF;
end;
5)Compile the library and save it.
6)Generate the library executable “custom.plx” using Oracle forms generate.
7)Copy the new library “custom.pll” and executable “custom.plx” to appsncaau1.0resource directory.



The risk exists when Oracle patches this form.So if you loose the change then you have to

reimplement this after applying the patch.

How to Display instance Site Name on window title in Oracle Apps 10.7NCA

An excellent solution...but created problems in some of the forms. So modified the logic slightly

in the CUSTOM.EVENT procedure as folows...
(This displays the sitename in the Main window only.)

declare
lv_app_title varchar2(100);
lv_site_name varchar2(100);
Begin
IF (upper(event_name) = 'WHEN-NEW-FORM-INSTANCE') THEN
IF fnd_profile.defined('SITENAME') = TRUE THEN
fnd_profile.get('SITENAME',lv_site_name);
lv_app_title := '<'||lv_site_name||'>';
set_window_property (FORMS_MDI_WINDOW,TITLE,'Oracle Applications'||' '||lv_app_title);
END IF;
END IF;
End;

如何用只讀方式打開特定responsibility的同一個form

In Oracle Applications, the System Administrator can grant/revoke
responsibilities to him/herself. In many organizations, it is imperative that not any one individual have such sweeping,

all-inclusive power. A simple and effective way to address this solution is to use the CUSTOM library.

The code below works against the Application Object Library user security definition screen.

It checks to see if the user has queried up his/her own record, and if
so, disables the entire responsibilities block.

PROCEDURE event(event_name VARCHAR2) IS
form_name VARCHAR2(30) := name_in('system.current_form');
block_name VARCHAR2(30) := name_in('system.current_block');
new_state number;
BEGIN
IF form_name = 'FNDSCAUS' THEN
IF event_name = 'WHEN-NEW-BLOCK-INSTANCE' THEN
IF block_name = 'USER_RESP' THEN
IF (fnd_profile.value('USERNAME') = name_in('USER.user_name')) THEN
new_state := property_false;
ELSE
new_state := property_true;
END IF;
set_block_property(block_name, insert_allowed, new_state);
set_block_property(block_name, update_allowed, new_state);
END IF;
END IF;
END IF;
END event;

保存當前環境做完作業後再恢复以前環境

old_profile := fnd_profile.value('conc_single_thread');
fnd_profile.put('conc_signle_thread','Y');
request_id := fnd_request.submit_requests(.......)
fnd_profile.put('conc_signle_thread',old_profile);

在建立function時可用Query_Only="YES". 來達到此form只可查詢的目的

但前提為在程式中必須有此參數可用

關於appl_initaliza

There is a procedure, APPS.FND_GLOBAL.APPS_INITIALIZE that will perform. exactly what you are looking to accomplish. The following is the declaration:

--
-- APPS_INITIALIZE - Setup PL/SQL security context
--
-- This procedure may be called to initialize the global security
-- context for a database session. This should only be done when
-- the session is established outside of a normal forms or
-- concurrent program connection.
--
-- IN
-- FND User ID
-- FND Responsibility ID (two part key, resp_id / resp_appl_id)
--
procedure APPS_INITIALIZE(user_id in number,
resp_id in number,
resp_appl_id in number);

Do note that this is only for database sessions that are not "normal" application sessions and should not be used in those contexts.

取得當前報表是何人產生的Select user_name from fnd_user where
user_id = (select requested_by from fnd_concurrent_requests where
reuqest_id=###)

以下為user guid 中取得

USERNAME               Your user’s current Oracle Application Object Library username.

USER_ID                       Your user’s current Oracle Application Object  Library user ID.

RESP_ID                        Your user’s current responsibility ID.

APPL_SHRT_NAME             The short name of the application connected to your user’s current responsibility.

RESP_APPL_ID                The application ID of the application connected to your user’s current responsibility.

FORM_NAME                   The name of the current form. Not available for concurrent programs.

FORM_ID                      The form. ID of the current form. Not available for concurrent programs.

FORM_APPL_NAME             The name of the application for which the current

                                    form. is registered. Not available for concurrent

                                     programs.

FORM_APPL_ID                  The application ID of the application for which the

                                      current form. is registered. Not available for

                                     concurrent programs.

LOGON_DATE                    Your user’s logon date for the current session.

LAST_LOGON_DATE             Your user’s logon date for the previous session.

LOGIN_ID                       Your user’s Sign–On Audit login ID in Oracle Application Object Library.

CONC_REQUEST_ID             instance of your running current program. You can only use this profile option in a concurrent

                                    program. You use this profile option to fill the REQUEST_ID Who column.

CONC_PROGRAM_ID            The program ID associated with a running current program. You can only use this profile option in a

                                   concurrent program. You use this profile option to fill the PROGRAM_ID Who column.

CONC_PROGRAM_APPLICATION_ID   The application ID associated with a running

                                         current program. You can only use this profile

                                         option in a concurrent program. You use this

                                         profile option to fill the

                                         PROGRAM_APPLICATION_ID Who column.

CONC_LOGIN_ID                The login ID associated with a running concurrent

                                    program. You can only use this profile option in a

                                    concurrent program. You can use this profile

                                    option to fill the LAST_UPDATE_LOGIN Who

                                     column.

CONC_PRINT_OUTPUT           The value Yes or No that you enter in the Print

                                    Output field when you register a concurrent

program. You can use the routine afpoput() from

your concurrent programs to change the value of

this profile option for a particular instance of your

running concurrent program. This profile option

determines whether the concurrent managers print

the concurrent program’s output to the printer.

CONC_PRINT_STYLE             The print style. of your concurrent program’s

output that you enter in the Print Style. field when

you register a concurrent program. You can use

the routine afpoput() from your concurrent

programs to change the value of this profile option


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11536986/viewspace-625333/,如需转载,请注明出处,否则将追究法律责任。

上一篇: FND_GLOBAL API's
请登录后发表评论 登录
全部评论

注册时间:2009-08-27

  • 博文量
    108
  • 访问量
    125848