Getting operator role id

  • 323 Views
  • Last Post 12 February 2019
PhinkTad posted this 08 February 2019

Hello,

I have different operator roles enabled in our project and I have a field in the document definition.

The field has the following script

Context.Text = FCTools.CurrentUserSession.RoleId.ToString();

The issue is that I have to refresh the field manually everytime to update the role id.
How can I get the operator id value to update as soon as the user opens the document?

Thanks!

 

hawkeye69 posted this 12 February 2019

Perhaps this will work: go into your Doc Def Properties. There is a tab called "Event Handlers" and a Handler named "After document rules are checked". Put your script there. You will have to reference the field by name in the script:

Document.Field("OperatorID").Text = FCTools.CurrentUserSession.UserName;

 If I understand this correctly, the rules are checked when someone opens the document. I'm not certain this will work for you, but worth a shot.

Adrian Enders

Close