Home » Developer & Programmer » Forms » how to show message 'do you want to save changes ?? ' (forms 10g)
how to show message 'do you want to save changes ?? ' [message #392947] Thu, 19 March 2009 14:45 Go to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
Hi,
i have 2 datablocks. one is 'A' other is 'B'.

datablock 'B' is inherited from 'A'.

i have a field called ID on 'B'.
i have same field ID on 'A'.

ID is lov field.

now what i want is, whenever i select value from lov into ID and click on any other item or tab page, i want to show the message "do u want to save changes?".
if i click yes,it should commit.
iam unable to understand in which trigger i should write the alert to show the message. i tried in different triggers which i felt were correct. but its not working.

and when i click on tabpage which has datablock 'A', the value which i gave in ID field on 'B' should be displayed in ID field of 'A'.
Re: how to show message 'do you want to save changes ?? ' [message #393030 is a reply to message #392947] Fri, 20 March 2009 01:14 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Don't worry, Forms will alert you when changes you've made are about to be lost unless you commit.

As of another question, take a look at "Copy value from item" and "Synchronize with item" item properties.
Re: how to show message 'do you want to save changes ?? ' [message #393177 is a reply to message #393030] Fri, 20 March 2009 11:44 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
both items are on different datablocks. i cant use copy from or synchronize in this case.

in when-tab-page-changed trigger i wrote:
go_item('A.ID');
execute_query;


this works for me for my second question .

now i want to show exactly same value in A.ID which i have selected in B.ID.

A block is a multirow. i want to show the value that was recently selected on B.ID.

about first question, do you mean that whenever i select a value from LOV and without saving if i click on any tab then form will show message to save ??

but iam not getting that message. was it not displayed somehow by using system.message_level??

where can i see this default saving message by forms?? can i be able to change it??

Re: how to show message 'do you want to save changes ?? ' [message #393240 is a reply to message #393177] Fri, 20 March 2009 15:51 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
both items are on different datablocks. i cant use copy from or synchronize in this case
Why not?
Forms Help
Specify this property in the form <block_name>.<block_item_name>.

Quote:
do you mean that whenever i select a value from LOV and without saving if i click on any tab then form will show message to save ?
Not at all. Changing a tab is not a reason for saving changes.
By default, :system.message_level = 0.
Re: how to show message 'do you want to save changes ?? ' [message #393399 is a reply to message #392947] Sun, 22 March 2009 09:46 Go to previous messageGo to next message
itech
Messages: 173
Registered: May 2008
Location: Fsd, Pakistan
Senior Member

have u tried on
when tab pages changed ?

get the record status for both blocks

if status is in insert or changed

then commit /or ask user to commit;
Re: how to show message 'do you want to save changes ?? ' [message #393853 is a reply to message #393399] Tue, 24 March 2009 12:35 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
can i use get_record_property function??

i want to give last record number as the first arguement of get_record_property function. how can i give this number?? what function should i use to get last record number of a block??

i can't give :last_record as first argument.

do i have to write it in when-tab-page-changed trigger??

Re: how to show message 'do you want to save changes ?? ' [message #394940 is a reply to message #393853] Mon, 30 March 2009 19:27 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: how to show message 'do you want to save changes ?? ' [message #395083 is a reply to message #393853] Tue, 31 March 2009 04:50 Go to previous messageGo to next message
itech
Messages: 173
Registered: May 2008
Location: Fsd, Pakistan
Senior Member

nastyjillu wrote on Tue, 24 March 2009 22:35
can i use get_record_property function??

i want to give last record number as the first arguement of get_record_property function. how can i give this number?? what function should i use to get last record number of a block??

i can't give :last_record as first argument.

do i have to write it in when-tab-page-changed trigger??




last_record;
will move the cursor to the last record of the block;
then u can use to get the status of last record using get_record_peroperty function.

=================
but can u explain your actual requirements, since this is not a standard approach of saving / commiting forms.
Re: how to show message 'do you want to save changes ?? ' [message #395092 is a reply to message #392947] Tue, 31 March 2009 04:57 Go to previous messageGo to next message
itech
Messages: 173
Registered: May 2008
Location: Fsd, Pakistan
Senior Member

but note, that if u are applying this code on some navigational trigger then it wil raise error.

i.e. u can not use it while navigation from an item to other, from record to next, block to block, etc..
Re: how to show message 'do you want to save changes ?? ' [message #395921 is a reply to message #395092] Fri, 03 April 2009 01:56 Go to previous message
UaEe
Messages: 9
Registered: March 2009
Junior Member
you called a trigger in wrong place
Previous Topic: Running forms in a client server environment
Next Topic: Open REF CURSOR ==> "this feature is not supported in client side programs"
Goto Forum:
  


Current Time: Fri Sep 20 12:28:06 CDT 2024