Well, that's because the calculation script returns false (= 0) if the expression is not met. var cResult = ""
if (DateField1.isNull eq 0) then
var nStartDate = Date2Num(Datefield1.formattedValue, "MM/DD/YYYY")
var nAddDays = ProjectLengthField.rawValue
var nEndDate = Sum(nStartDate, nAd...
You can set the selectedIndex property to change the value of a dropdown list. It takes a 0-based integer to select the nth item from the dropdown list. // Select the third item
DropdownList.selectedIndex = 2;
You can use FormCalcs Date2Num() method to convert a date into a number and Num2Date for the other way. Here an example:var nStartDate = Date2Num(Datefield1.formattedValue, "MM/DD/YYYY")
var nAddDays = ProjectLengthField.rawValue
var nEndDate = Sum(nStartDate, nAddDays)
DateField2 = Num2Date(nEndDat...
So you want to copy the information of each row unter DETAILS into the related row unter RETURN OF ITEMS I guess: Put this calculate script into the object "ReturnOfItems" an remove the other calculations script fromt the text fields.var nCount = _Enter1.count, // Count instances
oThat = this; // C...
Hi, there's another way to reset a form, which works better than resetData().Given the root node of you form is named "form1" than it looks this way.xfa.datasets.data.loadXML("<form1/>", true, true);
xfa.form.remerge();
You need to tell the form to start a recalculation, since this is only triggered automatically through changed values but not the presence of objects. Add this code to the existing script that controls the presence of your subforms. xfa.form.recalculate(true);
To have all instances of that dropdown with the same value, just set the binding to global and make sure each is named the same way. For the presence you would have to use additional scriptings to check the presence of a referenced dropdown and copy to all other instances of it. Can you provide a s...
The total average can be calculated the same way as shown above. You only need the set a different filter for the fields you're after. // Generic function to calculate average from numeric fields.
// If filters for any subform under pmp and any nested subform within which then includes a object Tabl...