It's possible to add new record with ajax report?
Hi all,
I would like to ask for your opinion on the ajax report. It's possible to add new record with ajax report.
My report is showed based on the code below;
function f_getReferenceRange()
{
var sAppId =$x('pFlowId').value;
var lvCode = document.getElementById('P11101_TI_CODE');
var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getReferenceRangeList',0);
ajaxRequest.add('GV_TEMP',lvCode.value);
ajaxResult = ajaxRequest.get();
if (ajaxResult)
{ html_GetElement('ReferenceRange').innerHTML = ajaxResult }
else
{ html_GetElement('ReferenceRange').innerHTML = 'No data found!' }
ajaxRequest = null;
}
APPLICATION_PROCESS:getReferenceRangeList_
declare
lv_User_List varchar2(30000) := null;
cursor read_c1_rec is
select TR_TI_CODE,
TR_AGETO,
TR_SEX_CODE,
decode(tr_agecode,'Y',round((tr_ageto/365),1), 'M', round((tr_ageto/30),1), round(tr_ageto/1,1)) Ageto,
TR_AGECODE,
TR_RANGE_DESC,
TR_NORMAL_LOLIMIT,
TR_UPPER_UPLIMIT,
TR_PANIC_LOLIMIT,
TR_PANIC_UPLIMIT,
TR_MRR_DESC,
'N' as vCheck
from tr_range
where TR_TI_CODE = UPPER(:GV_TEMP)
order by TR_AGETO ASC, TR_SEX_CODE DESC;
begin
begin
for i in read_c1_rec loop
lv_User_List := lv_User_List ||
apex_item.hidden(1, i.TR_TI_CODE) ||
apex_item.hidden(2, i.TR_AGETO) ||
apex_item.text(3, i.TR_SEX_CODE,3,1,'style="font-family:Verdana,Arial;font-size:12px;text-align:center;"'||'readonly="readonly"') ||
apex_item.text(4,i.Ageto,7,6,'style="font-family:Verdana,Arial;font-size:12px;text-align:center;"'||'readonly="readonly"')||
apex_item.text(5,i.TR_AGECODE,8,1,'style="font-family:Verdana,Arial;font-size:12px; text-align:center;"'||'readonly="readonly"')|| apex_item.text(6,i.TR_RANGE_DESC,20,20,'onkeydown="Tr_Range_Desc_KeyDown(this,event,'''||i.TR_SEX_CODE||''', '''||i.TR_AGECODE||''', '''||i.Ageto||''', '''||i.TR_RANGE_DESC||''');" style="font-family:Verdana,Arial;font-size:12px;text-align:left;"')||
apex_item.text(7,to_char(i.TR_NORMAL_LOLIMIT,'99990.999'),20,10,'onblur="f_CheckTRValue(this)" style="font-family:Verdana,Arial;font-size:12px;text-align:right;"')||
apex_item.text(8,to_char(i.TR_UPPER_UPLIMIT,'99990.999'),20,10,'onblur="f_CheckTRValue(this)" style="font-family:Verdana,Arial;font-size:12px;text-align:right;"')||
apex_item.text(9,to_char(i.TR_PANIC_LOLIMIT,'99990.999'),20,10,'onblur="f_CheckTRValue(this)" style="font-family:Verdana,Arial;font-size:12px;text-align:right;"')||
apex_item.text(10,to_char(i.TR_PANIC_UPLIMIT,'99990.999'),20,10,'onblur="f_CheckTRValue(this)" style="font-family:Verdana,Arial;font-size:12px;text-align:right;"')||
apex_item.hidden(11,i.TR_MRR_DESC)||
apex_item.checkbox(12,i.vCheck,'onClick="if (this.checked) {this.value =''Y'';}else {this.value=''N'';}"')||'
';
end loop;
exception when no_data_found then lv_User_List := '';
end;
htp.prn(lv_User_List);
end;
- > The "f_getReferenceRange()" fired when "P11101_TI_CODE" column onblur. On the report will showed on display area called "ReferenceRange".
It's possible to add a new record with above condition?
Anyone know how to do it?
Thanks
Best regards,
Liz