This topic is locked
[SOLVED]

 Get Field Value from Another Table When Sending Email

6/9/2010 4:12:52 PM
ASPRunnerPro General questions
J
Jay123 author

Hi!
I am using ASPRunner 6.1.
I would like to ask if it's possible to get a field value from another table when sending an email.
If I am sending email from the Add page of Table 1 and I would like to get some field value from Table 2, would it be possible?
I've tried inserting a record from Table 2 to Table 1 and it worked. However, the value was only captured in the List table. If my questin above is not possible, how can I insert the value from List page to Add page?
Thanks,

Jay

A
ann 6/10/2010

Jay,
here is a sample:

set rstmp = dal.Table("Table2").Query("FieldName2=" & values("FieldName1"),"")

msg = msg & "FieldName: " & rstmp("FieldName2") & vbcrlf

rstmp.Close:set rstmp = Nothing



where FieldName1 is a field in the table 2, FieldName2 is a field in the table 1.

J
Jay123 author 6/10/2010

Hi Ann,
Thanks. However, it didn't work.
How can I insert a field value from Table 2 to a field on Add Page of Table 1? I would like to use the Add Page before display event.
I have the "Organizer" field on Table 2 and I also have an "Organizer" field on Table 1. The admin will enter the "Organizer" value on Table 2. When the users see the Table 1 Add page, I want the "Organizer" value from Table 2 to be displayed on the "Organizer" field on Table 1.
Thanks,

Jay

J
Jane 6/11/2010

Jay,
use Add page: Before displayevent to select this values from Table 2 and save it in the session variable.

Then use this variable as default value on the "Edit as" settings dialog on the Visual Editortab.

J
Jay123 author 6/11/2010

Hi Jane,
Sorry to annoy you.
Here's what I didn.
On the Add Page: Before Display, I have added these codes:
dim rsExists

set rsExists = dal.Organizer.Query("Organizer='Organizer'","")

if not rsExists.eof then

xt.assign("Organizer")

end if

rsExists.Close : set rsExists = Nothing
On the "Edit as" Settings on the Visual Editor tab, I'm not sure how to insert the variable as default. I've tried xt.assign ("Organizer") but I got an error message.
Pls. advise. Note: Organizer is the table name of Table 2. Organizer is also the field name in Table 1 and 2.
Thanks,

Jay

A
ann 6/15/2010

Jay,
It's difficult to tell you what's happening without seeing actual files. Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

J
Jay123 author 6/15/2010

Thanks, Ann.
I have opened a ticket and attached the DB and Aspr file in the URL that you have mentioned. I don't know where the demo account is.
Thanks,

Jay

A
ann 6/16/2010

Jay,
'Demo Account' button can be found on the last screen in the program.

J
Jay123 author 6/19/2010

Hi Guys,
I have tried Jane's recommendation again but tweak it a little bit and it worked!
I was able to copy the value from Table2 to Table1 by creating a session variable in Table 2 (After record added) and then set that up as a default value in Table1.
Thanks,

Jay