Home » Developer & Programmer » Forms » Trigger for update of non-db items???
Trigger for update of non-db items??? [message #133920] Mon, 22 August 2005 14:49 Go to next message
ramisy2k
Messages: 150
Registered: April 2005
Senior Member
I have a form in which there is a database block plus there are many non-db items..
i have a button by pressing that all the data of non-db items is saved into another table..the values in these non-db items are not entered manually but come from certain events, and through tlists..in other words all thse non-db items never get focus of as all are display items..

the problem is that I want that if any change has been occured in any of these non-db items then the save button should become enabled else disbaled..

i would if ppreciate some one helps me to solve my problem

regards,
Asim.
Re: Trigger for update of non-db items??? [message #133943 is a reply to message #133920] Mon, 22 August 2005 18:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
When you populate the non-database items, determine the record number on the block, check the current record's status using get_record_property and if it is 'QUERY' use the set_record_property(rec_num, block, STATUS, CHANGED_STATUS) to make the record 'changed'. This will force your transaction triggers to fire on your table and you can then process the non-database items.

David
Re: Trigger for update of non-db items??? [message #133949 is a reply to message #133920] Mon, 22 August 2005 19:25 Go to previous messageGo to next message
ramisy2k
Messages: 150
Registered: April 2005
Senior Member
Hi DAVID,
thnks for ur answer i will try it shortly but my all non-db items are display items and as i told that the values are populated in them through tlists and some other events thus not manual entry. Where as transactional triggers like post change and When-validate-item fire when the focus moves from the changed/validated item to another item...

i dont think this will work!..
any other ideas to accomplish this...

also what if there is no databse block on the form?? and all items are display items...whose dats is stored/updated into another table through push of a button...



regards,
Asim
Re: Trigger for update of non-db items??? [message #133950 is a reply to message #133949] Mon, 22 August 2005 19:44 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Short answer - Try it and then post a response.

Long answer - Why would you change focus? How would you change focus? They are display only items and usually can not BE a focus. Don't ask me "whose dats is stored/updated into another table through push of a button", that's for you to specify. If nothing changes then you don't need to update anything, unless, by retrieving the data you wish to update something else (what, I don't know).

I think you need to give us more information, but do try my recommendation first.

David
Re: Trigger for update of non-db items??? [message #134271 is a reply to message #133950] Wed, 24 August 2005 02:46 Go to previous messageGo to next message
ramisy2k
Messages: 150
Registered: April 2005
Senior Member
Hi david,

i have tried ur menthod but its not working...


by using get_record_property I got the block status which was in 'insert' mode and then using the set_record_property(rec_num, block, STATUS, CHANGED_STATUS) I change the record ststus to 'changed'.

Then i used the When-validate-item/post change trigger on block level to make the save button enable incase of any change in any of the non db items but nothing happens and the button remins disabled

???

regards,
Asim.


Re: Trigger for update of non-db items??? [message #134420 is a reply to message #134271] Wed, 24 August 2005 18:06 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
IS the 'Save' button your own button or the 'save' button on the default smartbar?

Are you trying to 'go' to the button and then enable it? Don't! If it is your our button then use the set_item_property to enable it.

Please reply with the name of the block or blocks and a list of all the triggers you have defined at the form, block, and item levels.

David
Previous Topic: ...Next_record. to get the next value
Next Topic: set the increment no
Goto Forum:
  


Current Time: Fri Sep 20 01:50:21 CDT 2024