0 votes

Hi everyone!

At EasyCash they have created a new custom field "Department" which is mandatory.
Then when they tried to save email from Outlook it did not work because that field was not filled in.
I modified the workflow to set the current user's role as the "department".
My problem is that the department which is set is always the same, for every users.

After investigation, I found out that when i call the CurrentUser() method, Efficy returns the value zero (0), but only when the email comes from Outlook. So i can not get the right K_ROLE.

So my question is: "How do I get the ID of the user which create that case from Outlook?"



asked in WorkFlow / Serverscript by (167 points)
There is no CurrentUser() method available. Do you use Database.CurrentUserId()?
Yes Sorry, this is what I meant.
And what do all other user related methods return, like CurrentUserCode, CurrentUserFullName? It's very weird that the CurrentUserId() would return 0
It's not easy for me to investigate since I do not have a sidebar and Outlook installed on my remote desktop (at EasyCash) so I need to contact one user to test. I'm going to ask then I come back to you.
I also think that it's weird, adding the fact that it work fine when ticket are created from Efficy.
Uh? You shoudn't test it on site, I'm sure you can isolate this specific workflow and test it completely locally on your machine. Don't bother the client with this

1 Answer

0 votes

I ve just created a case from outlook then I can see that the field KUSER is well implemented by my KUSER.

so I would recommand you to simply use the AFTERCommit event function in your workflow and to read the value of your case record K_USER.

Best regards

answered by (986 points)
1,226 questions
1,495 answers
328 users