Re: Disabling Commit and Update
Date: 22 Jul 2003 17:44:29 -0700
Message-ID: <f0e3dc0b.0307221347.daccc20_at_posting.google.com>
[Quoted] As I said I could put the code in the various aspects. As you indicated that it would be ideal to have a simple procedure to handle the process and I agree.
But it is not indicated that way in my specs. The specs indicate that all forms of COMMIT, UPDATE etc be removed and only the possible way to do any sort of commit, update etc would be through a POST button.
The problem becomes when I null out the KEY-COMMIT or ON-UPDATE trigger and then call for a commit in the POST button it fails. It appears that the trigger catchs the commit. It must be due to the methods used in the button to do the actions.
I have resorted to added:
:global.trigger_disable := 'true'; -- added to the start of the POST
Button
:global.trigger_disable := 'false'; -- added to the end of the POST
Button
Then in the KEY-COMMIT, ON-UPDATE etc I added:
if if :global.commit_disable = 'false' then
message ('Commit not allowed here.');
else
commit;
end;
The tricky part comes when I do the on-update trigger. This simple trick will not work as easily as I update each row seperately and update different columns based upon special cases. The joy fun of it.
"Alan Mills" <Alan.Mills_at_xservices.pants.fujitsu.com> wrote in message news:<bfiu8r$2up4$1_at_news.icl.se>...
> "Jim" <jim_esti_at_hotmail.com> wrote in message
> news:f0e3dc0b.0307211014.3b7ee8f1_at_posting.google.com...
> > Hello,
> >
> > I have a basic form and a post button.
> > The user is able to view and query a particular table.
> >
> > When the user presses the post button some calculations are done and
> > the table they where looking at is updated via the post button only.
> > The calculations and features behind the post button are to
> > specialized and complex to do via update trigger or commit trigger.
> >
> > I can write the post button so that it updates the table correctly.
> > What I want to do is disable the user's ability to Commit and Update
> > that table via another means than that post button. When I try to add
> > triggers to the block the Commit and Updates it effects the updates
> > and commits I do on the POST button.
> >
> > How can one disable the Commit and Update keys/process and yet be able
> > to do the same functionality on a button? The only way I want to let
> > the user Commit or update is via this post button.
> >
> > Any Ideas?
>
> Not sure I understand your problem. What functionality can you put in you
> WHEN-BUTTON-PRESSED trigger that you think you can;t put in the standard
> KEY-COMMIT trigger then?
>
> The work should all be in packages and procedures and then called from
> anywhere necessary, i.e. both triggers mentioned above.
>
> If it's simply a required to 'disable' the commit key then define the
> KEY-COMMIT trigger to do nothing. Assuming your using a standardmenu it
> will effectively disable that too. Better still, remove the commit option
> from the menu as well.
>
> The other thing that occurs to me is that standard commit processing is not
> required by you because you are trying to bypass it by placing DML code
> directly into your WBP trigger. Although this works, it is not normally
> recommended and you asre advised to rethink your strategy (if this is what
> you're doing) to use the standard commit phase triggers for you DML.
Received on Wed Jul 23 2003 - 02:44:29 CEST