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

Question

Question

Can my form upload a file associated with an User Task?

asked on June 22, 2017

Hi All,

 

I am using version 10. I created a form that can let user to upload a file. After an user submits this form, LF will assign an User Task to a member by Round Robin. The uploaded file will be saved into LF repository.

 

Right now, the User Task event in my Process Diagram is associated with the form. However, I do not see any configuration in the User Task event to let me save uploaded file into LF repository. Does anyone know how I can make that happen in User Task event? If LF does not let me to do that, could you folks advise what I should design in my Process Diagram?

 

Thank you!

 

Alice

0 0

Replies

replied on June 22, 2017

You can use the Save to Repository element in the process designer either before or after the user task. In the Save to Repository options, you can set the options for saving the form as well as any uploaded files to the repository. 

0 0
replied on June 26, 2017

Thank you. 

 

After I submit the form, I encountered problem. I opened LFForms event log, it states:

Stack Trace:
Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException
Message: An unexpected error has occurred. [LFF502-UnexpectedError]


Inner exception: System.AggregateException
Message: One or more errors occurred.
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
   at Laserfiche.Forms.CommonUtils.FormsValidation.FormValidator.FormValidator`1.Validate()
   at E_Forms.Models.ViewModels.Form.Submit.ValidateForm(HttpRequestBase request, cf_forms form, Dictionary`2 Lookupdata, Dictionary`2 formdata, Dictionary`2 FieldsToIgnore, NameValueCollection formFields)
   at E_Forms.Models.ViewModels.Form.Submit.RetrieveDataFromForm(HttpRequestBase request, Dictionary`2 formdata, Boolean SaveAll)
   at E_Forms.Controllers.FormController.Submit(FormCollection collection)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)

Inner exception: Jint.Parser.ParserException
Message: Line 1: Unexpected token ILLEGAL
   at Jint.Parser.JavaScriptParser.ThrowError(Token token, String messageFormat, Object[] arguments)
   at Jint.Parser.JavaScriptParser.GetEscapedIdentifier()
   at Jint.Parser.JavaScriptParser.ScanIdentifier()
   at Jint.Parser.JavaScriptParser.Advance()
   at Jint.Parser.JavaScriptParser.Lex()
   at Jint.Parser.JavaScriptParser.ParseGroupExpression()
   at Jint.Parser.JavaScriptParser.ParsePrimaryExpression()
   at Jint.Parser.JavaScriptParser.ParseLeftHandSideExpressionAllowCall()
   at Jint.Parser.JavaScriptParser.ParsePostfixExpression()
   at Jint.Parser.JavaScriptParser.ParseUnaryExpression()
   at Jint.Parser.JavaScriptParser.ParseBinaryExpression()
   at Jint.Parser.JavaScriptParser.ParseConditionalExpression()
   at Jint.Parser.JavaScriptParser.ParseAssignmentExpression()
   at Jint.Parser.JavaScriptParser.ParseAssignmentExpression()
   at Jint.Parser.JavaScriptParser.ParseExpression()
   at Jint.Parser.JavaScriptParser.ParseStatement()
   at Jint.Parser.JavaScriptParser.ParseSourceElements()
   at Jint.Parser.JavaScriptParser.Parse(String code, ParserOptions options)
   at Jint.Engine.Execute(String source)
   at Laserfiche.Forms.CommonUtils.FormsValidation.FieldValidators.CustomRegex.IsValid(Object value, ValidationContext validationContext)
   at System.ComponentModel.DataAnnotations.Validator.TryValidate(Object value, ValidationContext validationContext, ValidationAttribute attribute, ValidationError& validationError)
   at System.ComponentModel.DataAnnotations.Validator.GetValidationErrors(Object value, ValidationContext validationContext, IEnumerable`1 attributes, Boolean breakOnFirstError)
   at System.ComponentModel.DataAnnotations.Validator.GetObjectPropertyValidationErrors(Object instance, ValidationContext validationContext, Boolean validateAllProperties, Boolean breakOnFirstError)
   at System.ComponentModel.DataAnnotations.Validator.GetObjectValidationErrors(Object instance, ValidationContext validationContext, Boolean validateAllProperties, Boolean breakOnFirstError)
   at System.ComponentModel.DataAnnotations.Validator.TryValidateObject(Object instance, ValidationContext validationContext, ICollection`1 validationResults, Boolean validateAllProperties)
   at Laserfiche.Forms.CommonUtils.FormsValidation.FieldValidators.FormField.Validate()
   at Laserfiche.Forms.CommonUtils.FormsValidation.FormValidator.FormValidator`1.<Validate>b__8_0(KeyValuePair`2 field)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)

0 0
replied on June 26, 2017

Hi Alice, 

 

can you post the regex you used to validate the the single line fields for your form. it might be the case that the regex parser in the backend is not accepting the format of your regular expression

0 0
replied on June 26, 2017

Hi Bohan,

Thank you!

 

In 'Layout' tab:

Phone: \d{3}-?\d{3}-?\d{4}-?

Date: /^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/

 

In 'CSS and JavaScript' tab:

$(document).ready(function () {

  $('#q77 input').keyup(function(){
    $(this).val($(this).val().replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3'))
    });
  
  $('#q79 input').keyup(function(){
    $(this).val($(this).val().replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3'))
    });
  
  $('#q219 input').keyup(function(){
    $(this).val($(this).val().replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3'))
    });
});
 

//Set current date
$(document).ready(function(){
      function today() {
        return new Date();
    }
  
      // Get formatted date YYYY-MM-DD
    function getFormattedDate(date) {
      return ("0" + (date.getMonth() + 1)).slice(-2)
          + "/"
          + ("0" + date.getDate()).slice(-2)
          + "/"
          + date.getFullYear();
    }
  
      $('#Field339').val(getFormattedDate(today()));
    $('#Field353').val(getFormattedDate(today()));
});
 

0 0
replied on June 26, 2017

Hi Alice,

 

The regex for phone field looks good, can you try this regex for date field instead:

^(0[1-9]|1[0-2])/(0[1-9]|1\d|2\d|3[01])/(19|20)\d{2}$

 

in essence, remove the leading and trailing backslashes. let me know if that resolves the issue.

thanks

0 0
replied on June 26, 2017

Thank you!

 

I replaced regex for all date fields with your suggestion, but still saw the same error messages in LFForm event log. Any ideas?

0 0
replied on June 27, 2017

Hi Alice

Are you currently using forms version 10.2 or 10.2.1. can you check the version number by navigating to the about page under your user profile dropdown in the top right corner?

 

thanks

0 0
replied on June 27, 2017

My version is 10.2.0.834

0 0
replied on June 27, 2017

try this for the date field regex:

 

^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$

 

thanks

0 0
replied on June 27, 2017

I tried this, that does not work. Sorry.

0 0
replied on June 27, 2017

can you try upgrading to the 10.2.1 patch, and trying the regexes for the fields. if that doesnt work can you open a support case and attach the business process containing the form that threw this error.

 

thanks

0 0
replied on June 27, 2017

fyi i was testing it on my end like this based on the regexes that you provided:

 

https://www.screencast.com/t/4vW1p8sJ5jUZ

 

let me know if that is not the way that you were implementing this

0 0
replied on June 28, 2017

The 10.2.1 update 1 hasn't been released yet. It is going through final testing and will be released soon. 

0 0
replied on June 28, 2017

Hi Jared,

 

Do you mean the update posted in this link is not released yet?

Link is https://support.laserfiche.com/download/3638/laserfiche-rio-10-2-1

 

Alice

0 0
replied on June 28, 2017

That link is for the initial 10.2.1 release that was made public in May. We will soon be releasing an update to 10.2.1 with a list of bug fixes. We will post another KB once that is released.

0 0
replied on July 12, 2017

I just updated 10.2.1 release. Now the error message changes to:

[9320]: Errors encountered during forms submission: <br>Field Name: Current Date, Position: 1, Error: This value is required. [LFF9300-ValueRequired] [LFF9312-ErrorOccuredDuringFormsValidation]<br> You can click the back button on the browser to correct and resubmit the form. [LFF9320-FormsValidationAggregateException]

 

However, Field Name: Current Date is for sure having value already. Why would Laserfiche say this value is required?

 

Thank you!

 

Alice

0 0
replied on July 28, 2017

@Alice Chiang

 

Check your form settings.  (The gear located near the top right corner)

 

After I installed 10.2.1 update 1, every form had the validation changed setting of "No Validation" change to "Validate User Input."  I was getting the exact same error you were getting until I switched it back.

 

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

Sign in to reply to this post.