l_num_vendor_site_id NUMBER;
l_num_hdr_org_id NUMBER;
BEGIN
IF (event_name = 'WHEN-VALIDATE-RECORD')
THEN
IF form_name IN ('APXINWKB')
AND block_name = 'INV_SUM_ACTIONS_CANVAS'
THEN
l_num_vendor_id := NAME_IN( 'INV_SUM_FOLDER.VENDOR_ID' );
l_num_vendor_site_id := NAME_IN( 'INV_SUM_FOLDER.VENDOR_SITE_ID' );
l_num_hdr_org_id := NAME_IN( 'INV_SUM_FOLDER.ORG_ID' );
BEGIN
SELECT attribute3
INTO l_chr_po_trans_mode_before
FROM po_headers_all
WHERE po_header_id = l_num_po_header_id;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
BEGIN
SELECT lookup_code
INTO l_chr_po_trans_mode_desc
FROM fnd_lookup_values
WHERE description = l_chr_po_trans_mode_before
AND lookup_type = 'PO TRANSMISSION MODE'
AND enabled_flag = 'Y'
AND NVL( start_date_active, SYSDATE ) <= SYSDATE
AND NVL( end_date_active, SYSDATE ) >= SYSDATE
AND language = USERENV( 'LANG' );
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
IF ( ( UPPER( l_chr_po_status ) = 'APPROVED'
AND l_num_po_rev_number = 0 )
OR l_num_po_rev_number > 0 )
THEN
IF ( NVL( l_chr_po_trans_mode_after, '#' ) <> NVL( l_chr_po_trans_mode_before, '#' ) )
THEN
fnd_message.set_name(
'XX_DIST'
,'XX_DIST_PO_TRANSMISSION_DFF'
);
fnd_message.error;
SET_ITEM_PROPERTY(
'INV_SUM_ACTIONS_CANVAS.APPROVE'
,enabled
,property_false
);
GO_ITEM('INV_SUM_ACTIONS_CANVAS.APPROVE');
COPY('N','INV_SUM_ACTIONS_CANVAS.APPROVE');
EXECUTE_TRIGGER('WHEN-CHECKBOX-CHANGED');
COPY('Y','INV_SUM_ACTIONS_CANVAS.APPROVE');
EXECUTE_TRIGGER('WHEN-CHECKBOX-CHANGED');
RAISE form_trigger_failure;
END IF;
END IF;
END IF;
END;
0 comments:
Post a Comment