Search Results for 'script'
-
Search Results
-
Topic: Scripting on iPad
I’d like to start by saying:
I had started using Tap Forms when Bento became obsolete. I loved it! When Tap Forms Pro came out I subscribed, iPad only, even though I’m no fan of subscription based apps. I let the subscription lapse because I didn’t see the value. However, the new updates called me back, and I renewed my subscription. I’m still not a fan of subscriptions, but I feel this one is worth it. I still don’t use it on my iMac. I need the iPad version only, so I’m hoping more of the Mac functionality comes to the iPad. Leading to my question!
Does scripting work okay on the iPad? I don’t mean, do scripts work, I mean writing them. There’s so little iPad documentation, I’m not sure what I can do.I’ve a simple form with two date fields (start and end) and some other fields. The first date field is populated with the current date. The second date field is empty. And some fields are hidden until the second field contains a date. To make it easier for the user, I’ve added a button to a Universal layout. When I click the button, the date field should be filled with the current date. I use this script for the task:
function MyScript() { var field_id = 'fld-b64c54dfb3de446fbf2b25b203c90104'; record.setFieldValue(field_id, new Date(), true); record.refreshCalculations(); form.saveAllChanges(); document.saveAllChangesAndRefresh(); record.refreshCalculations(); } MyScript();As you can see, I tried a lot to make the button work. But it doesn’t. After clicking, nothing happens. When I click on an empty area of the form, the second date field shos its content. But the hidden fields are still hidden, I’ve to switch layouts or record to let Tap Forms update the screen.
Is there a way to refresh the view? Or did I something wrong?
Hi Brendan,
I’ve noticed what seems to be a grouping issue with Number fields in Tap Forms Pro.
If a Number field contains a value and I delete that value, the field correctly appears empty. However, when I use this field with Group Records By, the record is placed in the 0 group, as if the empty field actually contained the value 0.
I checked the value with a script:
var value = record.getFieldValue(‘fld-0de…….’);
if (value === undefined) {
return “UNDEFINED — no value”;
}return “VALUE: ” + value;
For the affected record, the script returns:UNDEFINED — no value
So the Number field really is empty and does not contain 0. It seems that Group Records By is treating undefined and the numeric value 0 as the same grouping value.
Would it be possible for empty Number fields to remain in a separate empty group, rather than being grouped together with records whose value is actually 0?
Thanks!