Hello on a activity task of a case i want to introduce a formula considering the whole name of the current user / current user contact (I don't understand the difference)

I use [#System variable.Current user contact.Name#], but not recognize Name, aldo try using value, which is the correct way to get the name?

"Estimado " + [#System variable.Current user contact.Name#]+", le recordamos que debe completar su Declaración de Conflicto de Intereses en un plazo no más allá de "+[#System setting.Dias para completar Declaración#].ToString() +" dias."

 

Thanks

Like 1

Like

3 comments

Hello Julio,

To test everything on my side I've created a process like on the screenshot http://prntscr.com/phwxfh. This process creates an activity with following subject: "Test activity" + " "+ [#Read Contact record.First item of resulting collection.Full name#] + " " + "end of subject". And here is the result of this process http://prntscr.com/phwxxv. So please modify your process using my process as an example so to paste contact name inside some string field value.

Regards,

Oscar

Thanks Oscar

 

@oscar is really easiest, in my case i was to use [#Main record.Contact.Full name#]

Show all comments

Hi Community,

This code below gets the Guid of the current user in client side code

Terrasoft.SysValue.CURRENT_USER.value

How about in script task, using C# code what is its equivalent?

 

 

Like 0

Like

4 comments

In a script task you have access to UserConnection. This exposes a  CurrentUser property (which provides an object of type SysUserInfo). 

var currentUser = UserConnection.CurrentUser;
var userId = currentUser.Id;
var userName = currentUser.Name;

BTW If this was code in a source code schema/configuration service, you'd need to get the UserConnection via the AppConnection first:

var appConnection = HttpContext.Current.Application["AppConnection"] as AppConnection;
var currentUser = appConnection.SystemUserConnection.CurrentUser;

 

Ryan Farley,

Thanks Ryan,

Is there any documentation about CurrentUser. I want to know everything about its properties and attributes for future use.

Thanks.

Fulgen Ninofranco,

I don't know of any documentation, it is in Terrasoft.Core.dll, however, the SysUserInfo object inherits from the SysAdminUnit object. This object you can see in the configuration. Search for SysAdminUnit in the configuration and you'll see what is available in the SysUserInfo. The SysUserInfo object itself only adds 5 additional properties for TimeZone, PageRowsCounr, Culture, ClientIP, and DateTimeFormatCode.

Dear Fulgen,

Please use the example mentioned by Ryan, it covers the way you work with UserConnection in Script Task. 

var currentUser = UserConnection.CurrentUser;

For more information on all .Net classes used in the system please see this article:

https://academy.bpmonline.com/api/netcoreapi/7.13.0/index.html#GeneralS…

Also, as for examples of UserConnection usage in web services you can check the examples here:

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-create-cus…

 Regards,

Anastasia

Show all comments