This topic is locked
[SOLVED]

 How to use field data from current record in different column on list

5/7/2009 12:10:18 PM
ASPRunnerPro General questions
L
lyngaaskhan author

Running AspRunner 6.0 Build 766.

I can't seem to figure out how to us a field value in another column using asp code snippet on a list page.
Here's what I'm trying to do:
I have a table named "Orgs" with a field named "OrgNumber".

I have a column "orgnumber" on a list page. In design view, I've created a column after this column in which I want to display descriptions.

The description information is coming from a data source outside of the database i'm using in the asprunner project. I have code that works for this purpose if I can provide the org number.

The problem is I do not know how to reference the "Org" field in the asp code snippet. I've tried rs("OrgNumber"), dict("OrgNumber"), dal.Orgs.Value("OrgNumber"). None of these work.

I am able to get the data in an "after record processed" event using rs("OrgNumber"), but if I write the data to the page with response.write, the data shows all across the top of the page rather than within the table.
I suspect that this is a simple thing to do, but I'm at a bit of a loss with the changes between version 5.2 and 6.0.
Thanks,

Eric

Sergey Kornilov admin 5/7/2009

"ASP Code snippet" is not able to access recordset data.
I recommend to change 'View as' type of the column in question to 'Custom' and put your code there. You can access recordset variables as rs("FieldName") there.

L
lyngaaskhan author 5/7/2009

"ASP Code snippet" is not able to access recordset data.

I recommend to change 'View as' type of the column in question to 'Custom' and put your code there. You can access recordset variables as rs("FieldName") there.


Okay, thanks for the verification. I had already done what you've suggested.
For anyone else attempting to do the same sort of thing, here's what I did.
In design view, I selected html view and added a table cell after the last column.
Between the tag for my last field column- {END OrgNumber_fieldheadercolumn} -

and the tag for the end of the record header - {BEGIN endrecordheader_block} -
I added:
<TD class=headerlist_right style="VERTICAL-ALIGN: baseline" width=286><U><FONT color=#666666>Description</FONT></U></TD>
For the org field (my last data field), I added the following custom code:
strValue = strValue & "<td>" & getCuiBlues("ORG", strValue) & "</td>"
This writes the org field value followed by a new cell with my function which returns the org description. Looks perfect.