sapman_d
Posts: 3
|
Posted: 08/07/2009, 3:04 AM |
|
Hello,
Found different similar issues on the forum, but none with the exact problem (and solution).
Hope somebody can help me out with this.
On my page I have a simple 'mailto:' link. The reciptient should be extracted from the table "users" (field "email"), seperated by a semicolon.
Tried to code this in the 'before show' section, but unfortunately didn't succeed i creating the right code.
Can somebodey help me out, how to get output in the format: "recipient1@somewhere.comrecipient2@somewhere.comrecipient4@somewhere.com;".
Thanks in advance.
|
|
|
sapman_d
Posts: 3
|
Posted: 08/17/2009, 5:47 AM |
|
Currenty I've got it working with following code:
"
'Get mailadresses
Dim TPMConn
Dim NumberMax
Dim NumberMin
Dim i
Dim mailto
Dim mailto1
Dim TPMailGroup1
Dim TPMailGroup2
' Create a new database connection object
Set TPMConn = New clsDBRFC
TPMConn.Open
TPMailGroup1 = CCDLookup("Transport_Group_Id1", "RFC_Admin", "", DBRFC)
TPMailGroup2 = CCDLookup("Transport_Group_Id2", "RFC_Admin", "", DBRFC)
NumberMax = CCDLookup("Max(user_id)", "users", "group_id = 5 AND (officer_position = "& TPMailGroup1 &" OR officer_position = "& TPMailGroup2 &")", DBRFC)
NumberMin = CCDLookup("Min(user_id)", "users", "group_id = 5 AND (officer_position = "& TPMailGroup1 &" OR officer_position = "& TPMailGroup2 &")", DBRFC)
If NumberMin <> "" Then
Do While NumberMin <= NumberMax
mailto1 = CCDLookup("email", "users", "(officer_position = "& TPMailGroup1 &" OR officer_position = "& TPMailGroup2 &") AND group_id = 5 AND user_id = "& NumberMin, DBRFC)
If not (mailto1 = "") Then
mailto = mailto1&";"&mailto
End If
NumberMin=NumberMin+1
Loop
RFC_Transport.TPMail.Value = mailto
End If
TPMConn.Close
Set TPMConn = Nothing
"
However, I'm not sure this is the most efficient solution.
Any suggestions?
Greetings, Harold
|
|
|
|