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 -> General/Other

 Nested search list?

Print topic Send  topic

Author Message
Henryk

Posts: 63
Posted: 05/24/2004, 11:56 AM

Not sure how to title this. I have a tabel that holds tickets created for network issues. These tickets get updated but I currently have no method to track them. I would like, every time someone submits an updated ticket, a seperate table to store the login, a timestamp, and a field from the record called comments. I want that same ticket to also show a list of any comments made related to the ticket. Each ticket has a unique ticket id which each comment will be tied to. I hope I am explaining it clearly because it is just a germ of an idea in my head for now and I have not thought on it beyond trying to figure out how to incorporate all the comments from a comments table into the record view from the ticket table.

Henryk
View profile  Send private message
peterr


Posts: 5971
Posted: 05/24/2004, 6:22 PM

A related example of updating second table can be found in CCS docs.
http://docs.codecharge.com/studio/html/ProgrammingTechn...eCustomSQL.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Henryk

Posts: 63
Posted: 05/25/2004, 6:48 AM

Thank you Peter, that is an excellent start! That is the minimum I need to accomplish my goal, but I further wish to add, (basing off of the example you linked me to) into the task to include a comments field, filled in by the user when they update the task record, and then when I pull up the task record, a subquery will populate the record, kind of like a nested table with results from a search of the reports table for anything with the task id showing up in the record. Not sure how feasible this would be with the new records not having that kinda info yet
View profile  Send private message
peterr


Posts: 5971
Posted: 05/25/2004, 11:38 AM

You can add a TextArea control to your record form and do not specify any Control Source for it. Then in the After Insert event use its value to populate the 2nd table.
Then you can use the Before Show event to retrieve the value of that field probably using the Dookup functionality (usually CCDLookup function) and stuff it back into the TextArea control on the page.
I'm being generic because this is a General forum and not programming language specific. You can refer to the docs and examples regarding the specific solution for the programming language you use, for example http://docs.codecharge.com/studio/html/ProgrammingTechn...gleDBValue.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Henryk

Posts: 63
Posted: 05/25/2004, 11:48 AM

Generic response is perfectly ok :) you are pointing me in the right direction which should be sufficient. If I am understanding correctly, I would need two text fields, the one with no control source on the general record, and the record update table (reports table in the example) it would take that field and drop it into there. The second text area would be a placeholder for a query to fill with records from the reports table tied to the record id of the primary record. What I envision is nesting it with a table very similar to what the list view is like but not linked for editing. An alternative would be simply adding a link called "history which would return a standard filtered list view in a new window, which would be very easy to do, but I would rather have it nested in the record view itself. On the flip side it would be less cluttered that way. Thank you for your help peter, you are providing some great direction!

Henryk
View profile  Send private message
peterr


Posts: 5971
Posted: 05/25/2004, 12:19 PM

Hmm, I'm not sure now if I understand the full functionality you need.
I think though that you need only one textarea field if all you need are additional comments. Such field can be used with Control Source to read/write from/to the primary table or both primary and secondary tables, or without Control Source to read/write from/to secondary table.
I probably cannot fully visualize your page, but hopefully this will help.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Henryk

Posts: 63
Posted: 05/25/2004, 12:37 PM

Each update would add one record to the reports table, I will call it my logging table. The priomary table is a ticketing table. This one would have the primary information related to the incident, while the logging table would store any changes and the comments related to those changes. For example, my printer croaked. I create a ticket which would populate the ticketing table with the generic information, ie, ticket open time, ticket status, issue, location of device, etc. A tech would take the ticket and modify it and place his comments in as well. On his submit his comments, userid, status field, ticket id, and a timestamp would pop into the logging table while the regular table would have only changes such as the status changed from open to in progress. On this ticket would be a history of work done which would come from the logs table. Based on the ticket id of the ticket (primary unique identifier) a query would pull any logs which have the corresponding ticket id. Now picture the application builder and what its default look is when you run the application builder in ccs on this logging table, but no record view, just list view (with the fields userid, timestamp, comments, and status). Take this list view, strip the search functions so all you see is the records. The sticky part is nesting the results of the list view into the primary record itself for a quick glance of the history. It would be extremely easy to put a link on the ticket to open this stripped down list view passing the ticket id into the url and opening it in a new window, but for convenience it would be better to nest it into the ticket itself. Something similar to your support form I would think , essentially a list of messages with a suggestion for resolution, my reply, followed by his reply, followed by my closing it and reply (which by the way your support was stellar in my only issue with ccs, very prompt and resolved the problem). I think I can figure out how to do this, but I may need to hand code it myself, or put another grid into the record.

Henryk
View profile  Send private message
peterr


Posts: 5971
Posted: 05/25/2004, 12:44 PM

OK. In this case I think that your record could look strange and be stretched a lot when you have long history. It might better to display the history on the side, in a separate grid outside of the record form. But this is rather a design question at this point. If you decide to display the history directly inside the record then indeed you might need to manual create some programming loop that will retrieve and display all related records. In such case you could use the Label and replace its value with the HTML content that you build manually by retrieving those history records.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Sixto Luis Santos
Posted: 05/25/2004, 6:19 PM

Hello Henryk,

I don't quite grasp what you're trying to do. But if all you really want to
do is to nest some grids one inside the other, we might be able to help.
Please take a look here
http://ccs.ath.cx/~sixto/fo/repeater/ordersstats_report.php and tell me if
this, or something similar, is what you need.

Regards,

Sixto
Henryk

Posts: 63
Posted: 06/10/2004, 6:46 AM

*UPDATE*

For the benefit of those who use this for support here is what I did to get it to work. I set up session variables for the fields I wanted to use in my logging table. These were added to the insert and update section of the code where it pulls down the values. For each field I added something like this.

Session("Temp1") = DataSource.fieldname.Value

In addition to this I added some lines of code at the very bottom of all the other code.

<%
Session("Temp10") =CCGetRequestParam("TicketID", ccsGET)
%>

This pulls the ticketid of the current open ticket and there is a link on the page which will open a new window with the logs from the logging table which have that ticketid in it.

For the Ticket history (logs you get to from the link on the ticket) I created a simple search grid without any searches on the page. In the code I changed :

Where = ""
to

Where = "(ticketid='" & Session("Temp10") & "')"

The table that stores the logging info has names corresponding to the fields I want to track (for ease of interpretation)

The only drawback to this is on creation of a ticket the ticketid is 0, but on update it is the ticket number, which is no big deal to me since I have a hidden field for the NT login a user uses when accessing the page and doing an insert.

Now the sticky part was passing the log data into the log table. Initially I tried an after execute update event but that was not passing the new variables, but the ones from a prior insert. I finally went ahead and added the code to insert it into the table as a before load event on the confirmation page and that worked like a charm.

The other sticky part was the nt login. I had to strip out some of the username because the \ kept throwing off the insert.
This is what I used to pull it in and format it (probably not the cleanest code but it works)

userid = Request.ServerVariables("REMOTE_USER")
NTLogon = LCase(Right(userid, Len(userid) - InStr(1, userid, "\")))

that changes the login from "machinename\username" to simply "username" which cleared out an error message related to the \ I kept getting.

Hope that helps someone else with the same kind of needs :)

Henryk
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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