14 June 2013

Adding a Special Menu



a menuitem;



Begin

a := FIND_MENU_ITEM ('SPECIAL.SPECIAL15');

if (event_name = 'WHEN-NEW-BLOCK-INSTANCE') then

if (form_name = 'OEXOEORD' AND block_name = 'LINE') then

app_special2.instantiate ('SPECIAL15', 'Query Form');

SET_MENU_ITEM_PROPERTY (a, displayed, property_true);

SET_MENU_ITEM_PROPERTY (a, enabled, property_true);

end if;

end if;



if (event_name = 'SPECIAL15') then

if (form_name = 'INVIDITM') then

fnd_function.EXECUTE (function_name => 'INV_INVMATWB',

open_flag => 'Y',

session_flag => 'Y' );

end if;

end if;

12 June 2013

Orace Application Adding User and Adding Responsibility



User following PL/SQL to achieve the same,




DECLARE
l_user_id NUMBER;
l_resp_id NUMBER;
l_app_id NUMBER;
BEGIN
FND_USER_PKG.CreateUser (x_user_name => 'DEVUSER',
x_owner => NULL,
x_unencrypted_password => 'WELCOME123',
x_email_address => 'devuser@domain.com');

SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = 'DEVUSER';

SELECT responsibility_id, application_id
INTO l_resp_id, l_app_id
FROM fnd_responsibility
WHERE responsibility_key = 'SYSTEM_ADMINISTRATOR';

FND_USER_RESP_GROUPS_API.
insert_assignment (user_id => l_user_id,
responsibility_id => l_resp_id,
responsibility_application_id => l_app_id,
security_group_id => NULL,
start_date => SYSDATE,
end_date => NULL,
description => NULL);

COMMIT;
EXCEPTION
WHEN OTHERS THEN
raise_application_error ( -20001, 'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM);
END;