cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nintex Forms Jquery Not Asynchronous with Custom Jquery Issues

I believe I know what the problem is but I don't know how to fix it.

 

I have a Lookup form variable that queries a list in my sharepoint site. While this query is occuring several things seem to happen in this order:

1. my custom jquery code executes and sets up the form UI

2. form variable lookup completes and value is populated to a user name

3. nintex jquery code event handlers reconfigure the form's UI based on the new value

How do I change the order of execution so that my custom jquery runs after the lookup is complete and nintex jquery code executes?

Thanks

Labels: (2)
Tags (1)
0 Kudos
Reply
4 Replies
Workflow Hero

Re: Nintex Forms Jquery Not Asynchronous with Custom Jquery Issues

Hi Marek,

Please have a look at this post. This document will explain how to write custom JavaScript that reacts to various events in the filler.

JavaScript events in Nintex Forms

Please, note also that some controls do not provide events. For example, the Managed Metadata control is a SharePoint control, so we cannot hook into any events.

Hope this help you!

0 Kudos
Accept as Solution Reply
Not applicable

Re: Nintex Forms Jquery Not Asynchronous with Custom Jquery Issues

Hey thank you for the reply but I don't think I was clear enough about what is going on.

Currently I have a "Form Variable" in my Nintex form which the function:

If(endsWith(lookup("ELPs","ID",{ItemProperty:ELPID},"Sr. Manager"),userProfileLookup(Current User,"PreferredName") ),1,0)

Based on the result of this Lookup, my form will disable certain fields for the Sr Manager.

I also have my own custom javascript file "included" in the form that links to /sites/ELP/SiteAssets/file.js

What happens is my file.js runs it's jquery code and then is negated/undone when the Lookup Sr Manager field information comes in.

How do I wait for the Sr Manager info to come back before running file.js?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex Forms Jquery Not Asynchronous with Custom Jquery Issues

Hi Marek,

You are right there is no event available at the moment to use for this scenario. We need to consider to expose more control events available. Please raise this in our to product user voice site (nintex.uservoice.com)

0 Kudos
Accept as Solution Reply
Not applicable

Re: Nintex Forms Jquery Not Asynchronous with Custom Jquery Issues

My workaround was to create a calculated value set to the "form variable" and then poll for the value to change:

var setupView = function() {

  

    //run my jquery stuff

   

    var callback = $("div[data-ControlName='SrManager'] input").val();

   

    if (callback.length != 0) {

     clearInterval(poll);

    }

   };

  

   var poll = setInterval(setupView, 50);

0 Kudos
Accept as Solution Reply