每次使用 custom.pll 创建新记录时,都需要在多记录块中进行验证。
PLSQL
PROCEDURE EXP_FUNC_NEW_ITEM IS
lv_form_name varchar2(30) := name_in('system.current_form');
lv_block_name varchar2(30) := name_in('system.cursor_block');
lv_item_name varchar2(30) := name_in('system.current_item');
ln_total_amount_applied number:=0;
lv_approval_check varchar2(1):='Y';
BEGIN
if lv_form_name ='ARXRWMAI'
and lv_block_name='APP_FOLDER'
and lv_item_name ='APPLY_DATE'
then
copy(0,'APP_FOLDER.AMOUNT_APPLIED_DSP');
GO_ITEM('APP_FOLDER.AMOUNT_APPLIED_DSP');
end if;
if lv_form_name ='ARXRWMAI'
and lv_block_name='APP_FOLDER'
and name_in('APP_FOLDER.AMOUNT_APPLIED_DSP')!=0
then
ln_total_amount_applied:=0;
FIRST_RECORD;
LOOP
if name_in('app_folder.trx_number')='Refund' then
ln_total_amount_applied:=ln_total_amount_applied+name_in('app_folder.amount_applied');
end if;
Exit when name_in('SYSTEM.LAST_RECORD') = 'TRUE';
NEXT_RECORD;
END LOOP;
if ln_total_amount_applied !=0 then
---Checks the approval amount for the user
lv_approval_check:=EXP_UN_AR_RECEIPT_API_PUB.check_activity_authority
(name_in('ar_world.user_id'),
fnd_profile.value('org_id'),
ln_total_amount_applied,
name_in('app_folder.invoice_currency_code'),
name_in('app_folder.trx_number'));
end if;
if lv_approval_check='N' then
Fnd_message.set_string('You do not have authority to refund selected amount. Please contact your manager for details or change the amount applied and check again.');
Fnd_message.show;
GO_ITEM('APP_FOLDER.AMOUNT_APPLIED_DSP');
else
DO_KEY('CREATE_RECORD'); -- THIS PART IS THE ONE NOT WORKING.. IS NOT CREATING THE NEW RECORD
end if;
end if;
END;
问题是当点击选项卡创建新记录时,正在执行验证但未创建新记录。有任何想法吗 ?