CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Editable grid: Custom Insert

Print topic Send  topic

Author Message
tumby1974

Posts: 26
Posted: 05/21/2013, 8:21 PM

ok, I tried the help files, and looked up previous responses to Custom Insert on this ASP thread, and I still can't get mine to work.

My editable grid is pulling emp_id, emp_name, emp_dept from table EMP. On the editable grid I added a few textboxes for date, reg_hours, taken_hours, code.

I want to put into table PAYROLL the emp_id, emp_name, emp_dept, date, reg_hours, taken_hours, and code, so I put that into the custom insert section of the properties for the editable grid. So when I hit submit, it should send the data to PAYROLL, right?
View profile  Send private message
asoaresfil


Posts: 12
Posted: 05/22/2013, 12:53 AM

You have to be very carefull when working with custom updates.

If I understood, you are using an editable grid that is based on the EMP table to populate the PAYROLL table.

I suggest following some basic steps:

1: In datasource properties, use the Query Builder to define the relationship between EMP and PAYROLL tables. Please don’t forget to mark all fields that must be updated in the PAYROLL table.

2. If your table has an identity field, please check if Codecharge takes the correct one. Sometimes, depending on your database structure, Codecharge cannot “guess” the identity field. In this case you have to choose the correct one in the Query Builder.

3. In Custom insert or custom update (table based), Codecharge will not know if you want to add/edit the EMP or the payroll table. You must define one of them (probably payroll in your case).

4. If you define fields as LABELS, Codecharge will not be able to use these fields to insert/update the table. Codecharge can only use editable fields or hidden fields in custom update. The PAYROLL text fields you are including eventually would be prepopulated with EMP table info in BEFORE SHOW ROW, where payroll text field value is instantiated with EMP table field data (if necessary), avoiding retyping info that already is in your database.

5. Any field in custom insert comes from (editable or hidden) CONTROLS and NOT from datasource. The only field that is used from datasource is in the where box (when UPDATING OR DELETING). Codecharge takes the datsource field that was predefined in the Query Builder, take care.

6. If you are able to work with procedures, it is of course much more controllable and flexible than to work with tables. You can pass all controls to procedure parameters and INSIDE the procedure you can do anything you want, populate or update any table (or more than one table at same procedure execution). You even can use the same procedure for appending new records and updating existing ones (for example: if you don’t pass an ID, just append record; if you pass, just update record). All you need is to define the correspondence between EDITABLE/HIDDEN controls and procedure parameters.

7. In the last case be carefull: if you press at any time get CONTROLS, the editor assumes that you will take values from URL (even in the EDITABLE GRIDS). You will have to redefine everything…

I expect you can advance in your work.

{}
:-)
_________________
Alcides Soares FIlho
c2b@clickstobricks.info
Clicks to Bricks
www.clickstobricks.info

View profile  Send private message
tumby1974

Posts: 26
Posted: 05/22/2013, 12:36 PM

thanks, I'll take your tips into consideration!

by the way, is there an easier way to solve my issue above, besides using custom inserts?
View profile  Send private message

Add new topic Subscribe to topic   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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