Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › Problem with Search filters on ratings set in scripts
- This topic has 5 replies, 3 voices, and was last updated 3 years, 2 months ago by Martin Kendall.
-
AuthorPosts
-
August 28, 2021 at 2:22 PM #45127
Martin KendallParticipantHi,
I’m setting a star rating when I add a new record using a script.
When I do this the field value shows the correct number of stars in Tapforms – however if I create a search and query on, eg rating is 4, then the programmatically set four star records do not appear.
Any records entered manually do appear and if I change the rating of my scripted 4 stars, to another rating then change them back to four, they do filter correctly.
It just seems when they are set programmatically they don’t filter correctly.
I am using record.setFieldValue() to set the rating.
Can anyone tell me how I should be setting the rating so that the query works?
Thanks
Martin
August 29, 2021 at 10:55 AM #45130
BrendanKeymasterSaved searches get updated when you click on them. So what happens when you click on the main form and then click on the Saved Search afterwards? Does the record get included?
August 29, 2021 at 12:02 PM #45131
Martin KendallParticipantThank you for replying.
The saved search was set up months ago. The record was added using a script since then, and the phone has been rebooted (over the weeks) since it was added, but it still doesn’t appear.
I should say I am using Tapforms on my iPhone and iPad and even when the record is synced (using iCloud) it doesn’t appear on either device.
Hope you can help,
Martin
August 29, 2021 at 2:55 PM #45132
Daniel LeuParticipantIt seems that sometimes I have to click on
Refresh records list
in order to have records to show up in saved searches.August 31, 2021 at 2:20 AM #45137
BrendanKeymasterTry what Daniel suggested. But on iOS, to refresh the records list, pull down on the records list until you see the refresh message appear. Then let go.
August 31, 2021 at 4:06 AM #45138
Martin KendallParticipantI did try that after Daniel posted that comment. However I can’t get the refresh to do anything (I’ve pulled down a long way and nothing happens – see attached screenshot)
However, I have quit TapForms while the saved search is active, which means it is on when I return to that table, and it doesn’t show the script added 4 or 5 stars.
I could send a cut down example database if that would help.
Thanks
Martin
Attachments:
You must be logged in to view attached files. -
AuthorPosts
You must be logged in to reply to this topic.