Home » Developer & Programmer » Forms » Delete Trigger in Form Runtime (Developer 6I Database 10g Window XP)
Delete Trigger in Form Runtime [message #402923] Wed, 13 May 2009 03:52 Go to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Hi All

If this is possible to remove trigger on runtime for example

i write the trigger

SELECT COUNT(*) INTO :ITEM48 FROM SALE2;
      if
 :item48=12988 then
 set_item_property('pre',visible,PROPERTY_TRUE);
 set_item_property('new',visible,PROPERTY_TRUE);
 set_item_property('register',visible,PROPERTY_TRUE);
 set_item_property('close',visible,PROPERTY_TRUE);
 set_item_property('PRE',enabled,PROPERTY_TRUE);
 set_item_property('NEW',enabled,PROPERTY_TRUE);
 set_item_property('Code',enabled,PROPERTY_TRUE);
 set_item_property('close',enabled,PROPERTY_TRUE);
 set_item_property('OK',enabled,PROPERTY_FALSE);
  set_item_property('TEXT52',WIDTH,X_POS,18);
  set_item_property('TEXT52',WIDTH,Y_POS,252);
end if;
  


now i need when i press one "Code" button the its remove only this
SELECT COUNT(*) INTO :ITEM48 FROM SALE2;



its possible ? ? ?


Shahzaib ismail
Re: Delete Trigger in Form Runtime [message #402929 is a reply to message #402923] Wed, 13 May 2009 04:07 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
or edit this tigger ?
Re: Delete Trigger in Form Runtime [message #402951 is a reply to message #402929] Wed, 13 May 2009 04:46 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Not possible, but you may create a (global) variable when this "Code" button is pressed and test its value in your trigger. Something like
if :global.my_var = 'pressed' then
   null;
else
   select count(*) into :item48 from sale2;
   if :item48 = 12998 then
      do_whatever_you_do
   end if;
end if;

At the end, you might want to erase global variable's value.
Re: Delete Trigger in Form Runtime [message #402953 is a reply to message #402923] Wed, 13 May 2009 04:49 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not just use a datablock item?
I personally try to avoid using globals as they have tendency to cause confusion.
Re: Delete Trigger in Form Runtime [message #402964 is a reply to message #402953] Wed, 13 May 2009 05:16 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sure, why not?

Global variable is just one way to do that; parameter might also be an option. Data block item is a little bit more complicated as you have to have a (control?) data block, create an item, set its properties and then use it. Using a global variable seems to be the simplest.
Re: Delete Trigger in Form Runtime [message #403003 is a reply to message #402923] Wed, 13 May 2009 07:37 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
THERE IS ANY OPTION THAT TRIGGER FIRE ONLY ONE TIME


SHAHZAIB
Re: Delete Trigger in Form Runtime [message #403008 is a reply to message #403003] Wed, 13 May 2009 07:55 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No, as far as I can tell. Not without some programming, that is.
Re: Delete Trigger in Form Runtime [message #403011 is a reply to message #402923] Wed, 13 May 2009 08:08 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
It might help at this point if you actually told us:
a) which delete trigger you're talking about (forms has 4 delete related triggers)
b) what you're trying to achieve with it?
Re: Delete Trigger in Form Runtime [message #403116 is a reply to message #403011] Wed, 13 May 2009 15:49 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No, Cookiemonster, you have misread the question - it is not about a delete trigger. He would like to delete a trigger during runtime.

You know, execute a statement like
DELETE_TRIGGER('WHEN-VALIDATE-ITEM');
or
EXECUTE_THIS_TRIGGER_ONLY_ONCE('WHEN-VALIDATE-RECORD');
Re: Delete Trigger in Form Runtime [message #403215 is a reply to message #402923] Thu, 14 May 2009 05:02 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
So I did.

If the OP wants help controlling the flow of code it'd still help to know which trigger he's talking about.
Re: Delete Trigger in Form Runtime [message #403290 is a reply to message #402923] Thu, 14 May 2009 10:54 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Thanks for your reply both cookiemonster and littlefoot


basically i create a log on window where the user put user id and password and press "ok" button to log on my module now i need when the record of sale reach between 12988 and
15000 the other 2 text box (previous Code and New code) and 2 button (Register and Close ) enabled and my "ok" button will disable


in the previous code text box its show my code and the new code will be blank after the user ask me new code i will provide him

but when he enter new code and press register the two text box (Previous code and new code) and 2 button (Register and Close) will disable and ok button will enable i did all those thing successfully

but when i run the my log in window module its show me onces again (2 text box and 2 button)

i just need simple when its register successfully then it will not show the 2 text box and 2 button till sale record exceed 20000

I hope you both guys understand and will help me


Thanks and Regards


Shahzaib ISmail
Re: Delete Trigger in Form Runtime [message #403321 is a reply to message #403290] Thu, 14 May 2009 15:37 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I didn't change my opinion.
Previous Topic: lov color
Next Topic: hierarchical tree Problem
Goto Forum:
  


Current Time: Fri Sep 20 12:44:12 CDT 2024