AnsweredAssumed Answered

Refresh Calculated Value form field by JavaScript.

Question asked by darrentcs on Nov 28, 2017
Latest reply on May 23, 2018 by aartishaw

Hi all,

we have a requirement to force a calculated form field to refresh. It has a variable of ErrorCount. It is not connected to any SharePoint list column. 

We need to refresh the field this way as the calculated form field uses the lookup run-time function to return how many items are in a particular list, and give the total amount of items, using below formula:

 

count(lookup("ErrorList","Reference",Reference,"ID",true))


Whilst the form is open the list - that the calculated field returns the count from - gets updated - another item is added to it. When this happens we post a function called callback to the form.

Inside this function we need to update the calculated form field to show the new list total/ item count.

The function callback is successfully called, as we have confirmed with an alert, but the calculated form field is not  being refreshed, updated.

 

Inside our callback function we have tried:

 

function callback() {

alert('function called OK');

NWF$('#' + ErrorCount).trigger('blur');

NWF$('#' + ErrorCount).trigger('change');

 

}

 

Any idea on how to get the calculated form value field to recalculate /update?

Outcomes