sivaprasad9394
Occasional Collector

How to get the email of the user who starts the ScheduleEntry?

Jump to solution

Hello,

How to get the Email address of the user who starts the ScheduleEntry via file menu or ServerManager?

FS Version:5.2.426

Written the below code inside in public Object execute(Map<String, Object> params) method...

String userEmailAsReceipent = ((ScheduleContext) context)

                            .getUserService().getUser().getEMail();

                    String loginName = ((ScheduleContext) context)

                    .getUserService().getUser().getLoginName();

                    String realName =((ScheduleContext) context)

                    .getUserService().getUser().getRealname();

                    Long id = ((ScheduleContext) context)

                    .getUserService().getUser().getId();     

                    Logging.logInfo("Inside execute() 2param ReceipentEmail Empty in Property userEmail:"

                            + userEmailAsReceipent+" loginName:"+loginName+" realname:"+realName+" ID:"+id, LOGGER);

Output:

Inside execute() 2param ReceipentEmail Empty in Property userEmail: loginName:SYSTEM realname:SYSTEM ID:0

Always email is empty here.

How to get the value of the email?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
sivaprasad9394
Occasional Collector

I hope below code will help some one like me...

Working code....

User scheduleEntryUser = ((ScheduleContext) context).getTask().getScheduleEntry().getRunningEntries().get(0).getUser();

Thank you.

View solution in original post

0 Kudos
1 Reply
sivaprasad9394
Occasional Collector

I hope below code will help some one like me...

Working code....

User scheduleEntryUser = ((ScheduleContext) context).getTask().getScheduleEntry().getRunningEntries().get(0).getUser();

Thank you.

0 Kudos