Pulling Record List Doesn’t Update All Calculations & Scripts

Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch Forums Using Tap Forms Pro Pulling Record List Doesn’t Update All Calculations & Scripts

Tagged: 

Viewing 7 reply threads
  • Author
    Posts
  • June 3, 2025 at 10:53 AM #52365

    Harry
    Participant

    I have a form that has a script that calculates the difference in days between a given fixed date and today’s date. Since there is no manual field change, on my iPad, I pull down on the record list to update all the calculations and scripts. It is not working. It does work on my Mac when I click the recalculate button. And it works in TF5 on my iPad.

    To test, I created on my iPad in both TFP and TF5 a new form with two fields: a text field called Event and a calculation field with the formula containing only Now() with type Date. In TF5, the calculation field updates every time I pull down. In TFP, to update the calculation field, I pull down on the record list, then go back to the document, and close the document. Then I reopen the document, choose the form, and the field is updated.

    June 5, 2025 at 11:13 PM #52382

    Brendan
    Keymaster

    Sorry for the delay responding to this issue.

    I’m looking into it.

    July 24, 2025 at 5:21 PM #52745

    Harry
    Participant

    Still not working in 1.08 on iPad and iPhone.

    August 6, 2025 at 7:05 AM #52818

    Harry
    Participant

    Still not working in 1.09 on iPad and iPhone.

    August 7, 2025 at 12:51 AM #52822

    Brendan
    Keymaster

    I’m so sorry for not fixing this issue yet. I must have been distracted and forgot about it. What’s a bit odd is it’s displaying the result on the record details screen for every record after I added a Calculation field with the function Now() in it. But it’s not displaying on the list view.

    But I did find out that if you used this formula and had Tap Forms return a Text value instead of a Date value, then it will display on the list view:

    DATE(NOW(); "yyyy-MM-dd")

    Then that will work. It seems to be that it’s not displaying the results of a formula that’s returning a Date value.

    August 7, 2025 at 6:01 AM #52825

    Harry
    Participant

    No problem. I’m sure the launch of TFP has kept you pretty busy.

    In my original post, I used a calculation field to illustrate the problem. But I also use script fields in a few forms to calculate days between dates. The script fields are not working. Here’s a script that I use:

    function Days_Since() {
    
    var today = new Date(Date.now());
    today.setHours(0,0,0,0);
    
    let last_occurence_date = record.getFieldValue('fld-a00b75456ce64c09b3333f5205eebbae');
    last_occurence_date.setHours(0,0,0,0);
    
    var daysAgo = Math.round((today.getTime() - last_occurence_date.getTime()) / 86400000);
    
    if (daysAgo == 0) {
    	return "Today";
    } else {
    	if (daysAgo == 1) {
    	return "Yesterday";
    } else {
        if (daysAgo > 1) {
        return daysAgo + " Days Ago";
        }
    }
    }
    }    
    Days_Since();

    This field returns a text value.

    This field does not update when I pull down on the list. But it does update after I close the form and reopen it. That’s what I’ve been doing. Just a minor inconvenience.

    • This reply was modified 3 weeks, 6 days ago by Harry.
    • This reply was modified 3 weeks, 6 days ago by Harry.
    August 8, 2025 at 11:34 AM #52836

    Brendan
    Keymaster

    I’ve fixed this issue for the next update. Refreshing the records list to update the calculations now updates the records list values properly.

    August 8, 2025 at 12:43 PM #52838

    Harry
    Participant

    Thanks, Brendan. I look forward to the next update.

Viewing 7 reply threads

You must be logged in to reply to this topic.