Workflow Comment Created By Field

  • 25 February 2016
  • 2 replies
  • 0 views

Badge +6

I use a SmartForm to start a workflow, by executing the SharePoint Integration Workflow SmartObject’s StartWorkflow method.   When I call the StartWorkflow method, I pass the FQN of the user who is accessing the form to the method’s ImpersonateUser parameter so that the user’s name shows up as the originator.  If I don’t pass the user’s FQN, then my name shows up as the originator (since I was the one who deployed the workflow).  My workflow also executes the Workflow Comment SmartObject’s Add Comment method, to add a comment to the process that is started after the StartWorkflow method executes.  The comment text to be added is taken from the SmartForm that starts the workflow.  I’ve noticed that when someone other than me starts the workflow, my name shows up in the comment’s created by field, not the name of the other user, even though the other user is the originator.  Is this behavior by design?


2 replies

Userlevel 3
Badge +8

Dear ,

 

That behaviour is pretty weird , cuz from wt i know , originator is the one who started/initiated the workflow , doesnt matter who deployed it ,

anywho , since ur using a smartform , and start workflow from it ,

would it help if on that event , after ur start workflow action , to add "Execute SMO method" workflow comment create method

and expand system values from right pane , and expand current user , and send "Name" property and use it to save it in "Created By" field ,

would it still save ur name or would it take the real originator ?

 

16375i2E46B8C59C0772A6.png

 

Hope it helps!

Regards.

Badge +6

Yeah, it is strange behavior.  This looks to me like a bug, but I don't know for sure.

 

The reason I wanted to create a comment in the workflow, and not in the SmartForm, was that in order to create a comment, you need the Process ID.  I didn't have the Process ID available, as I was using the  SharePoint Integration Workflow SmartObject’s StartWorkflow method, which doesn't return the Process ID.  So, I replaced the  SharePoint Integration Workflow SmartObject’s StartWorkflow call with the SmartForms' StartWorkflow action, and moved the Add Comment call from the workflow to the SmartForm.  Once I did that, the comment took the name of the originator.  Thanks for your help!

Reply