This topic is locked

Pre populate field

3/13/2008 6:21:25 AM
ASPRunnerPro General questions
N
nitzan author

I need to pre populate a field in three places:

Edit, View and List.

I managed to do it in the view screen, using the values("column")

to locate the existing viewed row key, which is required in order to

do query on another table to get the required value to populate.
However, I couldn't figure out how to get the current row key in the other two screens,

as they don't have any such parameter in the event input (BeforeShowEdit/List).
How can I know what is the current row key for these events, and how can I then populate

the column I need, after I have the required data to populate?

I guess in the Edit page I need to use the smarty with the name within the template?

And how about the list?

J
Jane 3/13/2008

Hi,
key value is passed through URL on the edit page.

For example use this code in the Edit page: Before process event:

Dim keyvalue

keyvalue = Request("editid1")

...


Also you can use After record processed event on the list page. All values are stored in the rs dictionary in this event.

N
nitzan author 3/13/2008

I already tried using the rs in the after process, however I'm not able to update the recordset (recordset not updatable).

So, I will be able to know the current key, but how to update a rs column so it will display later another value?

Hi,

key value is passed through URL on the edit page.

For example use this code in the Edit page: Before process event:
Also you can use After record processed event on the list page. All values are stored in the rs dictionary in this event.

J
Jane 3/14/2008

Hi,
if you want to update value in the database you need to contsruct SQL query and execute it.

To update value on the list page only edit row dictionary.

Here is a sample:

row("1FieldName_value") = "another value"



where FieldName is your actual field name.