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

Question

Question

Stored procedure on submission of form

asked on October 20, 2017

I recently upgraded to Forms 10.2.1 and had the code below working in 10.1 but after the upgrade I get an error when submitting.  I've diagnosed it to be a problem with the javascript because when I take it out, the form submits as expected (but the stored procedure does not run).  Please help!  

Code that was working in 10.1

$(document).ready(function(){

//Change Title of Tab
  $('title').text('INTERNAL CLAIM FORM')
//End Title
  
//Required fields red
  $('.cf-required').parent().css('color', 'red');
//End required fields red
  
$('#q3 input').attr('readonly', 'true');//this is the claim number field I'm looking to fill with the stored procedure

  $('.action-btn').on('click', function(event)  //On submit event make sure that all required fields are satisfied
  {
    var hasEmptyRequiredFields = $.grep($('.required'), function(value, i) {
  		return $(value).val() === '';
    });
    if ($('.notused').val() === 0 && hasEmptyRequiredFields.length === 0)//Notused is a hidden field that defaults to 0, then changes to 1, triggering my stored procedure
    {
      event.preventDefault();
      $('.notused input').val("1").trigger('change');//This is the stored proc trigger

      var interval = setInterval(function(){
        if($('#q3 input').val() !== '') {
          clearInterval(interval);
          $("#form1").submit();
        }
      }, 500);
    }
  });
});  

Thanks,

Nate

0 0

Replies

replied on October 21, 2017

What error do you get when you submit?

0 0
replied on October 23, 2017

Ege, 

This is the error shown to users.  

 

In the event log:  

The description for Event ID 7 from source Laserfiche-Forms-App cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

An unexpected error has occurred. [LFF502-UnexpectedError]

Details:
URL: /Forms/Form/Submit
Error: UnexpectedError
Date: 10/23/2017 8:50:36 AM (US Eastern Standard Time)
HTTP Status Code: 500
Business Process ID: 0
User: ADMIN
IP: 10.100.1.102
Browser: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Business Process Name: 

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


Inner exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
   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)


502

The publisher has been disabled and its resource is not available. This usually occurs when the publisher is in the process of being uninstalled or upgraded

Thanks,

Nate

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

Sign in to reply to this post.