CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Variable display of add/update/delete buttons

Print topic Send  topic

Author Message
Rene
Posted: 06/13/2002, 3:29 PM

This is probably a really stupid newbie question but I'm new to CCS and I know next to nothing about programming...I'm sure this is an easy one for you guys. I'm trying to create a record form that will show Add, Submit (or Update), and Delete buttons based on whether or not a key field is null. This will allow me to use the same record form for adding, modifying, or deleting records...and more importantly, to allow users to create a new record from an existing one. Right now the user sees either Add or Submit/Delete depending on how they get to the form. Bottom line...I want them to be able to click on a value in a grid and have it open that record in a record form which includes an Add button so that they could create a new record based on existing data (after clearing the key field).

The page is called ADDRFQ, the record is called RFQ, and the field in question is called RFQ_NUM. I've added custom code as shown below to the page After Initialize event and I've also tried adding it to the record Before Show event...it doesn't work in either place. Here's what I've written for Page Before Initialize just to see if I could make the buttons go away as a test when an existing record was opened:

dim rfq_num
if rfq_num <> NULL then
addrfq.UpdateAllowed = False
addrfq.DeleteAllowed = False
addrfq.InsertAllowed = False
end if

For Record Before Show I just changed "addrfq" to "rfq".

What am I doing wrong?
CodeCharge Support
Posted: 06/14/2002, 6:44 AM

Rene,
1. to hide buttons use following code in Record form Before Show event:
<form_name>.<button_name>.Visible = False
or
<form_name>.<operation_name>Allowed = False

if "rfq_num" is the field on the record form, then to access its value use:
if form_name.rfq_num.Value <> 0 then

2. in case you want to have several buttons on the form at the same time, e.g.
Update, Delete, Add, Copy
buttons in form update mode you'd rather create custom "Add" and "Copy" buttons that will be visible in update mode. That let you to preserve functionality of generated 'Insert' button.
Do not assign operation to the custom button but create Button server side onClick event and put custom code to execute sql query.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.