You are viewing limited content. For full access, please sign in.

Question

Question

How to add Approval/ Rejection comments to metadata (Saving to Repository) activity

asked on February 27, 2019 Show version history

Dears ,

I need to save list of all comments added during all steps of LF Form.

I need to add them to a multi value field in LF Repository in format like this:

User1+ (2/22/2019 11:14:05 AM) + comment 

User2+ (2/27/2019 2:39:26 PM) + comment 

.......

 

 

 

0 0

Answer

SELECTED ANSWER
replied on February 27, 2019

Dears,

I made it with these steps:

Retrieving values from Retrieve Business Process Variables:

  1. %(Submission Timestamps)
  2. %(Submission Comments)
  3. %(Submission Submitter Accounts)

 

 

Then I used this SDK script to build comments field values:

 

        protected override void Execute()
        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session

            var CommentsAll=GetTokenValue("CommentsAll");
            var CommentsTime=GetTokenValue("CommentsTimeAll");
            var ActionsSubmissionAll=GetTokenValue("ActionsSubmissionAll");
            
			List<string> CommentsList=new List<string>();
          
            try
            {
                List<object> CommentsAllList = ((IEnumerable)CommentsAll).Cast<object>().ToList();
                List<object> CommentsTimeAllList = ((IEnumerable)CommentsTime).Cast<object>().ToList();
                List<object> ActionsSubmissionList = ((IEnumerable)ActionsSubmissionAll).Cast<object>().ToList();


				for (int i = 0; i < CommentsAllList.Count; i++)
                {
                    try{
                        CommentsList.Add(ActionsSubmissionList[i]+"("+CommentsTimeAllList[i].ToString()+")"+"- "+ CommentsAllList[i]);
                    }
                    catch(Exception ex1)
                    {

                    }
                }   
            }
            catch(Exception ex)
            {
              SetToken("Exception",  ex.Message);
            }

            SetToken("CommentsList",CommentsList);

        }
    }

 

Then I used "CommentsList" to assign value.

 

 

Thanks.

3 0

Replies

replied on March 2, 2020

I used Javascript to disable the default comment box for the user task.

I added my own multi-line field for comment entry.

 

Pros: No need to involve LF Workflow or SDK.  Good for simple Forms processes.

Cons: Since I omitted the comment box, no comments will show in the right panel, when an approver access the form.

 

 

 

1 0
replied on March 3, 2020

Thank you for your update , good solution.

But did you checked it with the Laserfiche App?

0 0
replied on March 3, 2020

Yes.  The comments persist throughout the multiple approval processes and into the repository without any code.

Here is my javascript code:  .comment-section{display:none;} 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.