AnsweredAssumed Answered

Nintex Form for office365 hangs with loading symbol

Question asked by schallagolla on Dec 10, 2015
Latest reply on Dec 11, 2015 by schallagolla

Hi,

 

In office365\SharePointOnline environment on a custom list (say the list name is A)Nintex form, I referenced external JS file and wrote some script using Jquery\Rest ApI to fetch data from different listB, so that I can hide a Repeating section on listA, based on value from ListB. The below script executes perfectly on List A i.e. gets the data and hides the control in question. But, the form, ListA Nintex form is stuck on loading symbol for long time and never finishes (Screen Shot attached) .

 

Custom Script in Fetch.js(Executes on Form load of ListA)

var spHostUrl;
var appWebUrl;
 
$(document).ready(function() {
spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
   
    var scriptBase = spHostUrl + '/_layouts/15/';   

   
     $.getScript(scriptBase + "SP.js", function() {
      $.getScript(scriptBase + "SP.RequestExecutor.js", getEmployeeDept);
     });      
   
});


function getEmployeeDept() {

 

var executor = new SP.RequestExecutor(appWebUrl);
    var url = appWebUrl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('ListB')/items?@target='" + spHostUrl + "'&$select=Exempt";   
   
    executor.executeAsync({
    url: url,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
      var jsonObject = JSON.parse(data.body);
      var isExempt = jsonObject.d.results[0];           
         if(isExempt)
         {
             NWF$(".rptSection").hide(); 
         } 
      },
    error: function (data, errorCode, errorMessage) {
       console.log("Unable to fetch records." +errorMessage);
    }
  });

}

I referenced files in Form-Setting -- Advanced -- Custom javascript
includes as below:-

https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js

https://mySharepointSite/SiteAssest/Code/JS/Fetch.js

 

So, how to get away with this issue of form hanging? Is there a way to force further execution once my above script executes?

 

Thanks,

Attachments

Outcomes