Friday, August 21, 2009

Agile Project Management

Agile Open Source Project Management Tool

http://collaborate.d2labs.org/projects/saralscrum/

3 Reasons Why I Wouldn't Do Agile Project Management

http://www.agile-software-development.com/2009/03/3-reasons-why-i-wouldnt-do-agile.html

10 Key Principales of Agile Development

http://www.agile-software-development.com/search/label/10%20Key%20Principles

How to put Log lines in OA Framework program

OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getOADBTransaction();

if(oadbtransactionimpl.isLoggingEnabled(2)) { oadbtransactionimpl.writeDiagnostics(this, "insertRow().BEGIN", 2); }

Through this if we have enabled Diagnostic on then we can see our logs while runtime.

We can put anywhere in our OA Framework program.

There are Diagnostic option Show Log on Screen

Log Level
Unexpected (6)Error (5)Exception (4)Event (3)Procedure (2)Statement (1)

Easy way to install Apache, MySql, PHP etc

Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
http://www.apachefriends.org/en/xampp.html

Wednesday, August 19, 2009

Create Service Request and Task through API

declare
lx_msg_count NUMBER;
lx_msg_data VARCHAR2(2000);
lx_request_id NUMBER;
lx_request_number VARCHAR2(50);
lx_interaction_id NUMBER;
lx_workflow_process_id NUMBER;
lx_msg_index_out NUMBER;
lx_return_status VARCHAR2(1);
l_service_request_rec CS_ServiceRequest_PUB.service_request_rec_type;
l_service_request_rec_out CS_ServiceRequest_PUB.sr_create_out_rec_type ;
l_notes_table CS_SERVICEREQUEST_PUB.notes_table;
l_contacts_tab CS_SERVICEREQUEST_PUB.contacts_table;
j number;
lx_individual_owner NUMBER;
lx_group_owner NUMBER;
lx_individual_type VARCHAR2(100) ;

begin

FOR J IN 1 .. 10000
LOOP
-- Populate the SR Record type
--l_service_request_rec.incident_country:= 'US';
--l_service_request_rec.incident_postal_code:= '45202';
l_service_request_rec.incident_location_type :='HZ_PARTY_SITE';
l_service_request_rec.INCIDENT_LOCATION_ID := 276016; --262651;
l_service_request_rec.incident_occurred_date := SYSDATE;
l_service_request_rec.INSTALL_SITE_ID := 276016; --262651;
l_service_request_rec.request_date := SYSDATE;
l_service_request_rec.type_id := 10006; ---
l_service_request_rec.status_id := 1; ---
l_service_request_rec.severity_id := 2; ---
l_service_request_rec.urgency_id := 2;---
--l_service_request_rec.owner_id := 100000101;
l_service_request_rec.summary := 'SR API TEST'; ---
l_service_request_rec.caller_type := 'ORGANIZATION';
l_service_request_rec.customer_number := '276421CH'; --'100692CH'; ---
--l_service_request_rec.verify_cp_flag := 'N';
l_service_request_rec.inventory_item_id := 628814; --607498;
l_service_request_rec.inventory_org_id := 45;
l_service_request_rec.category_id := 3346;
l_service_request_rec.category_set_id := 1;
IF ( l_service_request_rec.owner_id IS NULL
OR l_service_request_rec.owner_id = Fnd_Api.g_miss_num
)
THEN
l_service_request_rec.territory_id := NULL;
ELSE
l_service_request_rec.territory_id := 83;
END IF;

l_notes_table(1).note := 'Test Note';
l_notes_table(1).note_detail:= 'Note details entered here'; -- NULL
l_notes_table(1).note_type := 'ACT_HIS';

dbms_output.put_line('Before calling Public SR API');

cs_servicerequest_PUB.Create_ServiceRequest (
p_api_version => 4.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_TRUE,
x_return_status => lx_return_status,
x_msg_count => lx_msg_count,
x_msg_data => lx_msg_data,
p_resp_appl_id => 690,
p_resp_id => 21787,
p_user_id => 10780,
p_login_id => 00,
p_org_id => 150,
p_request_id => null,
p_request_number => null,
p_service_request_rec => l_service_request_rec,
p_notes => l_notes_table,
p_contacts => l_contacts_tab,
P_auto_assign => 'Y',
p_auto_generate_tasks => 'Y',
x_sr_create_out_rec => l_service_request_rec_out,
p_default_contract_sla_ind =>'N',
p_default_coverage_template_id => 0);

if l_service_request_rec_out.auto_task_gen_attempted THEN
dbms_output.put_line('auto task gen status : TRUE');
end if;

dbms_output.put_line('Return Status : ' lx_return_status);
dbms_output.put_line('Inserted request id: ' l_service_request_rec_out.request_id );
dbms_output.put_line('Inserted request num : ' l_service_request_rec_out.request_number );
dbms_output.put_line('Interaction ID : ' l_service_request_rec_out.interaction_id );
dbms_output.put_line('auto task gen status 'l_service_request_rec_out.auto_task_gen_status);
--dbms_output.put_line('auto task gen attempted : 'l_service_request_rec_out.auto_task_gen_attempted);

IF (lx_return_status <> FND_API.G_RET_STS_SUCCESS) then
IF (FND_MSG_PUB.Count_Msg > 1) THEN
--Display all the error messages
FOR j in 1..FND_MSG_PUB.Count_Msg LOOP
FND_MSG_PUB.Get( p_msg_index => j,
p_encoded => 'F', p_data => lx_msg_data,
p_msg_index_out => lx_msg_index_out);

DBMS_OUTPUT.PUT_LINE(lx_msg_data);
END LOOP;
ELSE
--Only one error
FND_MSG_PUB.Get( p_msg_index => 1,
p_encoded => 'F',
p_data => lx_msg_data,
p_msg_index_out => lx_msg_index_out);DBMS_OUTPUT.PUT_LINE(lx_msg_data);
DBMS_OUTPUT.PUT_LINE(lx_msg_index_out);
END IF;
END IF;
END LOOP;
exception
when others then dbms_output.put_line('in others main ' sqlerrm);
end;

Monday, August 3, 2009

Prints the whole menu tree for a given responsibility

SET SERVEROUTPUT ON size 1000000
SET LINESIZE 20000
SPOOL c:/submenu_menu.txt

declare
-- this method prints the whole menu tree for a given responsibility
-- if you want to run for a different responsibility change the
-- l_resp name

l_resp_name varchar2(100) := 'NCR Call-1 Agent';
l_menu_id number;
l_main_menu varchar2(100);

procedure dfs(p_menu_id in varchar2, p_level in number) is

cursor get_submenus is
select e.entry_sequence, m.menu_name, m.user_menu_name, e.sub_menu_id, e.function_id, f.function_name, e.prompt, f.web_html_call, f.user_function_name, e.grant_flag
from fnd_menus_vl m, fnd_menu_entries_vl e, fnd_form_functions_vl f
where e.sub_menu_id = m.menu_id(+)
and e.function_id = f.function_id(+)
and e.menu_id = p_menu_id
order by 1;

l_spaces varchar2(30) := '';
granted varchar2(30);

begin
-- spacing
for i in 1..p_level loop
l_spaces := l_spaces || '..';
end loop;

--loop through menus
for c in get_submenus loop
granted := '';
if c.grant_flag = 'Y' then granted := ' [granted]'; end if;
if c.sub_menu_id is null then
dbms_output.put_line(l_spaces || 'FUNCTION ' || nvl(c.prompt, '[hidden]') || granted || ' ' || c.function_name || ' (' || c.user_function_name || ')');
-- dbms_output.put_line(l_spaces || '...........src=' || c.web_html_call);
else
dbms_output.put_line(l_spaces || 'MENU (' || p_level || ') ' || nvl(c.prompt, '[hidden]') || granted || ' ' || c.menu_name || ' (' || c.user_menu_name || ')');
end if;
dfs(c.sub_menu_id, p_level+1);
end loop;
end;
begin
select menu_id into l_menu_id
from fnd_responsibility_vl where responsibility_name = l_resp_name;
select menu_name into l_main_menu from fnd_menus where menu_id = l_menu_id;
dbms_output.put_line('MAIN MENU ' || l_main_menu);
dfs(l_menu_id, 1);
end;
spool off;