Home » Developer & Programmer » Forms » fnd_message.set_string
fnd_message.set_string [message #681226] |
Sat, 27 June 2020 08:42  |
 |
GHDSSS
Messages: 13 Registered: April 2020
|
Junior Member |
|
|
Hello Team,
Hope everyone doing good and safe
I have a Question, My client required to update multiple records in the form, so I have added Checkboxs and write a query in when_button_pressed for the requirement Please find the Query below
DECLARE
v_comments1 VARCHAR2(4000) := NULL;
v_comments2 VARCHAR2(4000) := NULL;
v_comments3 VARCHAR2(4000) := NULL;
l_old_value NUMBER;
l_count NUMBER := 0;
BEGIN
v_comments1 := :so_exe.shiplinelov
|| '-'
|| substr(:so_exe.line_shipping, instr(:so_exe.line_shipping, '-') +
1);
v_comments2 := :so_exe.shiplinelov;
v_comments3 := :so_exe.line_shipping;
go_block('so_exe');
first_record;
LOOP
IF :so_exe.cb = 'Y' THEN
l_count := l_count + 1;
IF l_count > 1 THEN
IF l_old_value != :so_exe.order_number THEN
fnd_message.set_string('Different Order numbers Cannot update Order Line');
fnd_message.show();
RAISE form_trigger_failure;
END IF;
END IF;
l_old_value := :so_exe.order_number;
IF :so_exe.promise_date1 IS NULL THEN
fnd_message.set_string('Cannot update field is blank');
fnd_message.show();
ELSIF
:so_exe.line_shipping IS NULL AND :so_exe.shiplinelov IS NULL
AND v_comments2 IS NOT NULL
THEN
UPDATE oe_order_lines_all
SET
promise_date = :so_exe.promise_date1,
shipping_instructions = v_comments2
WHERE
line_id = :so_exe.line_id;
IF :system.last_record = 'TRUE' THEN
fnd_message.set_string('Success');
fnd_message.show();
END IF;
ELSIF
:so_exe.line_shipping IS NULL AND :so_exe.shiplinelov IS NULL
AND v_comments2 IS NULL
THEN
fnd_message.set_string('Cannot update field is blank');
fnd_message.show();
ELSIF
:so_exe.promise_date1 IS NOT NULL AND :so_exe.line_shipping IS NOT NULL
AND v_comments2 IS NOT NULL
THEN
UPDATE oe_order_lines_all
SET
promise_date = :so_exe.promise_date1,
shipping_instructions = v_comments1
WHERE
line_id = :so_exe.line_id;
IF :system.last_record = 'TRUE' THEN
fnd_message.set_string('Success');
fnd_message.show();
END IF;
ELSIF
:so_exe.promise_date1 IS NOT NULL AND :so_exe.line_shipping IS NULL
AND v_comments2 IS NOT NULL
THEN
UPDATE oe_order_lines_all
SET
promise_date = :so_exe.promise_date1,
shipping_instructions = v_comments2
WHERE
line_id = :so_exe.line_id;
IF :system.last_record = 'TRUE' THEN
fnd_message.set_string('Success');
fnd_message.show();
END IF;
ELSIF
:so_exe.promise_date1 IS NOT NULL AND :so_exe.line_shipping IS NOT NULL
AND v_comments2 IS NULL
THEN
UPDATE oe_order_lines_all
SET
promise_date = :so_exe.promise_date1,
shipping_instructions = v_comments3
WHERE
line_id = :so_exe.line_id;
fnd_message.set_string('Success');
fnd_message.show();
END IF;
END IF;
IF :system.last_record = 'TRUE' THEN
EXIT;
END IF;
next_record;
END LOOP;
standard.commit;
first_record;
END;
The Code is successfully updating the row but the challenge I'm facing is to display fnd_message.set_string , I have two fnd_message.set_string "success" and "Cannot update, the field is blank" if I put fnd_message.set_string in the loop this message is displaying every time, it updates each row but I need to display after every row is updated, and if I put fnd_message.set_string out the loop, both the messages are displaying please suggest me
[EDITED by LF: applied [code] tags]
[Updated on: Mon, 29 June 2020 01:38] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Feb 23 13:39:46 CST 2025
|