do you want to save changes [message #134228] |
Wed, 24 August 2005 00:46 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
VSPB
Messages: 27 Registered: August 2005
|
Junior Member |
|
|
i've a master form. on its exit button i've written
exit_form(ask_commit);
so that it will ask before exiting. but it gives the message even if no changes are made. and if i click yes it also saves a blank record...
|
|
|
|
Re: do you want to save changes [message #134519 is a reply to message #134267] |
Thu, 25 August 2005 07:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
VSPB
Messages: 27 Registered: August 2005
|
Junior Member |
|
|
Well yes i pass some null values on When-new-form-instance. but i need to give them...
Here is my code
WHEN-NEW-FORM-INSTANCE-TRIGGER
:DI_EMPNAME := :PARAMETER.P_EMPNAME;
begin
if :PARAMETER.P_ITEMID is not null then
set_block_property('ITEM_M',default_where,'ITEM_ID='||:PARAMETER.P_ITEMID);
go_block('ITEM_M');
execute_query;
end if;
--Code for enabling/disabling the month of usage text box on the basis of seasonal item
IF :IS_SEASONAL_ITEM = 'N' or :IS_SEASONAL_ITEM = '' THEN
SET_ITEM_PROPERTY('month_of_usage',enabled,property_false);
:month_of_usage := '';
else
SET_ITEM_PROPERTY('month_of_usage',enabled,property_true);
SET_ITEM_PROPERTY('month_of_usage',update_allowed,property_true);
END IF;
--Code for enabling/disabling the month of usage text box on the basis of seasonal item end
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type
IF :Reorder_Type = '' or :Reorder_Type is null THEN
SET_ITEM_PROPERTY('Lead_Value',enabled,property_false);
:Lead_Value := '';
else
SET_ITEM_PROPERTY('Lead_Value',enabled,property_true);
SET_ITEM_PROPERTY('Lead_Value',update_allowed,property_true);
END IF;
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type end
end;
DECLARE
group_id RecordGroup;
List_id Item := Find_Item('item_location_d.ITEM_LOCATION_ID');
status NUMBER;
BEGIN
group_id := Create_Group_From_Query('RACK_NAME','SELECT RACK_NO,to_char(ITEM_LOCATION_ID) FROM ITEM_LOCATION_M order by RACK_NO');
status := Populate_Group(group_id);
Populate_List(List_id,group_id);
END;
|
|
|
Re: do you want to save changes [message #134631 is a reply to message #134519] |
Thu, 25 August 2005 17:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Okay, here's your code back at you-- WHEN-NEW-FORM-INSTANCE-TRIGGER
declare
begin
:DI_EMPNAME := :PARAMETER.P_EMPNAME;
begin
if :PARAMETER.P_ITEMID is not null then
set_block_property ('ITEM_M', default_where,
'ITEM_ID=' || :PARAMETER.P_ITEMID);
go_block ('ITEM_M');
execute_query;
end if;
--Code for enabling/disabling the month of usage text box on the basis of seasonal item
IF :IS_SEASONAL_ITEM = 'N'
or :IS_SEASONAL_ITEM = '' THEN
SET_ITEM_PROPERTY ('month_of_usage', enabled, property_false);
:month_of_usage := '';
else
SET_ITEM_PROPERTY ('month_of_usage', enabled, property_true);
SET_ITEM_PROPERTY ('month_of_usage', update_allowed, property_true);
END IF;
--Code for enabling/disabling the month of usage text box on the basis of seasonal item end
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type
IF :Reorder_Type = ''
or :Reorder_Type is null THEN
SET_ITEM_PROPERTY ('Lead_Value', enabled, property_false);
:Lead_Value := '';
else
SET_ITEM_PROPERTY ('Lead_Value', enabled, property_true);
SET_ITEM_PROPERTY ('Lead_Value', update_allowed, property_true);
END IF;
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type end
end;
DECLARE
group_id RecordGroup;
List_id Item := Find_Item ('item_location_d.ITEM_LOCATION_ID');
status NUMBER;
BEGIN
group_id :=
Create_Group_From_Query
('RACK_NAME',
'SELECT RACK_NO,to_char(ITEM_LOCATION_ID) FROM ITEM_LOCATION_M order by RACK_NO');
status := Populate_Group (group_id);
Populate_List (List_id, group_id);
END;
end; I recommend that you ALWAYS put the block identifier in your code. Don't just have ':DI_EMPNAME' but use ':BLK.DI_EMPNAME'.
Why are you setting the 'Lead_Value' to null string? I suggest you test for it being 'not null' before doing the assignment.if :blk.Lead_Value is not null then
:blk.Lead_Value := NULL;
end if;
David
|
|
|
Re: do you want to save changes [message #134689 is a reply to message #134631] |
Fri, 26 August 2005 04:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
VSPB
Messages: 27 Registered: August 2005
|
Junior Member |
|
|
hi david,
thanks for the suggestion of using block identifier... i will keep in mind from now on...
i tried assigning NULL and checking it before assignment but it didnt work. it still gives the message on the click of exit button even if no changes are made...
Please help...
|
|
|
|
Re: do you want to save changes [message #134906 is a reply to message #134890] |
Sun, 28 August 2005 22:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
swchen
Messages: 15 Registered: July 2005 Location: malaysia
|
Junior Member |
|
|
Hello, Mr.David i also have facing the same problem now. The message 'Do you want save change you make' will keeping prompt out even i din make any change at record. Actually, what cause making the message keeping prompt out?? Sir, you have any idea or advise to us to avoid this happen?? Thanks,have nice day.
|
|
|
Re: do you want to save changes [message #134909 is a reply to message #134906] |
Sun, 28 August 2005 23:36 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
As I said in my previous post - "Forms does NOT ask for a Save if there are no changes".
Put a message('trigger name: status 1 ='||:system.record_status); pause;" statement into as many of your triggers as is necessary, and in as many places as possible. Just remember to change the 'number' so that each message is unique.
Compile and run your form and follow the flow of your form via the messages that are displayed.
David
[Updated on: Sun, 28 August 2005 23:37] Report message to a moderator
|
|
|
Re: do you want to save changes [message #134917 is a reply to message #134909] |
Mon, 29 August 2005 00:32 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
VSPB
Messages: 27 Registered: August 2005
|
Junior Member |
|
|
hello Mr. David,
i tried showing the message
message('trigger name: status 1 ='||:system.record_status); pause;
and three places i got status = CHANGED
1ST - POST QUERY OF THE MASTER BLOCK...
IF :IS_SEASONAL_ITEM = 'N' or :IS_SEASONAL_ITEM = '' THEN
SET_ITEM_PROPERTY('month_of_usage',enabled,property_false);
:month_of_usage := '';
else
SET_ITEM_PROPERTY('month_of_usage',enabled,property_true);
SET_ITEM_PROPERTY('month_of_usage',update_allowed,property_true);
END IF;
message('trigger name: status 6 ='||:system.record_status); pause;
2ND & 3RD - WHEN NEW FORM INSTANCE...
--Code for enabling/disabling the month of usage text box on the basis of seasonal item
IF :IS_SEASONAL_ITEM = 'N' or :IS_SEASONAL_ITEM = '' THEN
SET_ITEM_PROPERTY('month_of_usage',enabled,property_false);
:month_of_usage := '';
else
SET_ITEM_PROPERTY('month_of_usage',enabled,property_true);
SET_ITEM_PROPERTY('month_of_usage',update_allowed,property_true);
END IF;
--Code for enabling/disabling the month of usage text box on the basis of seasonal item end
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type
IF :Reorder_Type = '' or :Reorder_Type is null THEN
SET_ITEM_PROPERTY('Lead_Value',enabled,property_false);
:Lead_Value := '';
else
SET_ITEM_PROPERTY('Lead_Value',enabled,property_true);
SET_ITEM_PROPERTY('Lead_Value',update_allowed,property_true);
END IF;
--Code for enabling/disabling the Lead Value text box on the basis od Reorder Type end
message('trigger name: status 2 ='||:system.record_status); pause;
DECLARE
group_id RecordGroup;
List_id Item := Find_Item('item_location_d.ITEM_LOCATION_ID');
status NUMBER;
BEGIN
group_id := Create_Group_From_Query('RACK_NAME','SELECT RACK_NO,to_char(ITEM_LOCATION_ID) FROM ITEM_LOCATION_M order by RACK_NO');
status := Populate_Group(group_id);
Populate_List(List_id,group_id);
END;
message('trigger name: status 3 ='||:system.record_status); pause;
but i cannot change the above code... i need to assign those null values to LEAD_VALUE and MONTH_OF_USAGE... and populate the 'ITEM_LOCATION_D.ITEM_LOCATION_ID' list item... but this code is making changes in the form... is there any other way i can do it. it will be very helpful... thank you...
|
|
|
|
Re: do you want to save changes [message #134925 is a reply to message #134920] |
Mon, 29 August 2005 01:27 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
VSPB
Messages: 27 Registered: August 2005
|
Junior Member |
|
|
I am setting those items to NULL in the When-New-Form-Instance because when the form opens for a new entry lead_value should be null till any reorder_value is selected and month_of_usage should be null till seasonal_item is not checked.
if :blk.Lead_Value is not null then
:blk.Lead_Value := NULL;
end if;
i tried this but it didnt work...
|
|
|
|
|
Re: do you want to save changes [message #135084 is a reply to message #134974] |
Mon, 29 August 2005 18:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
You sayQuote: | am setting those items to NULL in the When-New-Form-Instance because when the form opens for a new entry lead_value should be null till any reorder_value is selected
|
WNFI is for FORM things, you say 'for a new entry', you should think more along the lines of When-New-Record-Instance not WNFI.
Okay, these 'assignments' are really validation tests. I suggest that you put the logic into When-Validate-Item triggers on the various fields. For example, on month_of_usage and seasonal_item have a WVI that tests to make sure that the pair of fields are compatiable. If they aren't then tell the user they are wrong and do a 'raise form_trigger_failure'.
David
[Updated on: Mon, 29 August 2005 18:09] Report message to a moderator
|
|
|