If (form_name='OEXOEORD' and block_name='LINE')then
If (event_name='WHEN-NEW-BLOCK-INSTANCE') then
param_header_id := name_in('order.header_id');
param_order_type := name_in('order.order_type');
param_freight_terms := name_in('order.freight_terms');
BEGIN
SELECTCOUNT ( * )
INTO l_cnt
FROM oe_order_lines_all
WHERE header_id = param_header_id;
EXCEPTION
WHEN OTHERS
THEN
l_cnt
:= 1;
END;
BEGIN
SELECTCOUNT (DISTINCT x.lookup_type)
INTO l_cnt1
FROM(SELECT lookup_type
FROM fnd_lookup_values
WHERE lookup_type = 'AUTOPOPULATE_FREIGHT'
AND TAG = 'FREIGHT_TERM'
AND DESCRIPTION = param_freight_terms
AND NVL (END_DATE_ACTIVE, SYSDATE) <= SYSDATE
AND ENABLED_FLAG = 'Y') x,
(SELECT lookup_type
FROM fnd_lookup_values
WHERE lookup_type = 'AUTOPOPULATE_FREIGHT'
AND TAG = 'ORDER_TYPE'
AND meaning = param_order_type
AND NVL (END_DATE_ACTIVE, SYSDATE) <= SYSDATE
AND ENABLED_FLAG = 'Y') y
WHERE x.lookup_type = y.lookup_type;
EXCEPTION
WHEN OTHERS
THEN
l_cnt1
:= 0;
END;
if
(l_cnt < 1 and l_cnt1 > 0 ) then
OM_FREIGHTLINES_PRG
(param_header_id,param_order_type,param_freight_terms,fnd_global.user_id,fnd_global.resp_id,fnd_global.resp_appl_id);
-- do_key('ENTER_QUERY');
do_key('EXECUTE_QUERY');
end if;
end if;
end if;
No comments:
Post a Comment