VishalMistry
6th October 2015, 07:46
Hello Everyone,

I want to get user's email id from session ttaad2500m000 (Maintain User session). Actually at the table level, ttaad200 does not store email id. when I checked, it is a form field and I don't know from where is it reading user's email id. When I am making call through stpapi by calling ttaad2500m000, I am able to get user's name based on user id but not email id. following is my code:
stpapi.put.field( "ttaad2500m000", "ttaad200.user", hold.user )
stpapi.find("ttaad2500m000")
stpapi.get.field( "ttaad2500m000", "ttaad200.name", hold.name )
stpapi.get.field( "ttaad2500m000", "email", hold.name )
message(hold.name) | displays nothing as i dont know how to read form field

Can anybody guide what is wrong ?

Vishal

bhushanchanda
6th October 2015, 09:44
Hi,

You don't need AFS. The email id's are stored in Address Book session(ttcmf2100m000) So, just do a select on table ttcmf200 in company 0.

JaapJD
6th October 2015, 10:10
If you still want to use AFS :-):

stpapi.put.field( "ttaad2500m000", "ttaad200.user", hold.user )
stpapi.find("ttaad2500m000")
stpapi.handle.subproc("ttaad2500m000", "ttams1100s000", "add")
stpapi.synchronize.dialog( "ttaad2500m000", "display", error.msg )
stpapi.get.field( "ttams1100s000", "email", hold.name )
stpapi.end.session("ttams1100s000")
stpapi.end.session("ttaad2500m000")

bhushanchanda
6th October 2015, 10:17
Or without handle-


stpapi.put.field( "ttaad2500m000", "ttaad200.user", hold.user )
stpapi.find("ttaad2500m000")
stpapi.synchronize.dialog("ttaad2500m000","display",hold.name)
stpapi.get.field( "ttams1100s000", "email", hold.name )
message(hold.name)
stpapi.end.session("ttams1100s000")
stpapi.end.session("ttaad2500m000")

VishalMistry
8th October 2015, 09:27
Hi Bhushan-Ji,

It works. Thanks a lot for your valuable help.

Vishal