Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms Pro › Manual Sorting Feature Looks Promising!
- This topic has 5 replies, 3 voices, and was last updated 1 month, 1 week ago by
Glen B.
-
AuthorPosts
-
September 10, 2025 at 2:49 PM #52946
ShaneParticipantOne of the newest features of TFPro is the manual sorting feature. For those who aren’t aware of it, it allows you to manually drag and drop records in any order you want. This lends itself to a really interesting application – task management.
I use TF for task management. The problems is when you have several tasks with high priority and want to choose which high priority task to start first. In TF5 I would create a numeric value for the sort order and sort that way. It works, but is tedious to sort by manually entering numeric values for teach task (record). This is where drag and drop manual sorting comes in really handy.
I’m not sure if Brendan thought about this potential market. There are a million task managers (todoist, Monday, Clickup), but none of them would have the depth of a database application like TFPro. However, most task managers have drag and drop sorting capabilities.
Unfortunately at this point the manual sorting only works in the Single Column List view. It would be great to extend this feature to Multi-column list view, as well as to the Linked-form field object in the Layout pane. #feature-request :)
-
This topic was modified 1 month, 2 weeks ago by
Shane.
Attachments:
You must be logged in to view attached files.September 10, 2025 at 6:36 PM #52950
BrendanKeymasterHi Shane,
I’m glad you’re enjoying the manual sort feature. The multi-column list view doesn’t support drag and drop, so that’s why I haven’t enabled it for that view. And since the Link to Form fields use the same control as that, that’s why they also don’t support manual sorting.
Thanks,
Brendan
September 11, 2025 at 12:20 PM #52959
ShaneParticipantThat’s a bummer. Is it a limitation of the view controller class in Xcode/ Swift? Sorry, at the moment I’m a beginner when it comes to programming in Xcode/ Swift outside of web technologies.
-
This reply was modified 1 month, 2 weeks ago by
Shane.
September 11, 2025 at 12:52 PM #52962
BrendanKeymasterThe table view control is written in Objective-C actually. It’s all custom to make it work like a spreadsheet similar to Excel. I could change it to an NSTableView control (which is what the List view is based on), but then you couldn’t select just a single cell. You can only select an entire row. But it would let me do drag and drop. However, I don’t think it’s a good enough tradeoff though.
September 18, 2025 at 5:32 AM #52979
Glen BParticipant/**
* This script is designed to be run from a button on the Order form layout.
* The button should be configured to “Run Script Field Script”.
*/
function findAndSetStreet() {
// The ‘record’ object is automatically available when a script is
// run from a button on a record’s layout.
var currentRecord = record;
var orderForm = form;
if (!currentRecord) {
Utils.alertWithMessage(‘Error’, ‘This script must be run from a record.’);
return;
}
var companyForm = document.getFormNamed(‘Company’);
if (!companyForm) {
Utils.alertWithMessage(‘Script Error’, ‘Could not find the “Company” form.’);
return;
}
// — CONFIGURATION —
// On the line below, change “Company” to the EXACT name
// of your company pick list field.
var companyField = orderForm.getFieldNamed(‘Company’);
// ———————
var streetField = orderForm.getFieldNamed(‘Street’);
if (!companyField || !streetField) {
Utils.alertWithMessage(‘Script Error’, ‘Could not find your Company Pick List or Street fields.’);
return;
}
var selectedCompanyName = currentRecord.getFieldValue(companyField.getId());
if (!selectedCompanyName || selectedCompanyName === ”) {
Utils.alertWithMessage(‘No Company’, ‘Please select a company before clicking this button.’);
return;
}
var companyNameField = companyForm.getFieldNamed(‘Company Name’);
var companyStreetField = companyForm.getFieldNamed(‘Company Street’);
if (!companyNameField || !companyStreetField) {
Utils.alertWithMessage(‘Script Error’, ‘Could not find “Company Name” or “Company Street” fields in the Company form.’);
return;
}
var companyRecords = companyForm.fetchRecords();
var matchingStreets = [];
for (var i = 0; i < companyRecords.length; i++) {
var companyRecord = companyRecords;
var companyName = companyRecord.getFieldValue(companyNameField.getId());
var street = companyRecord.getFieldValue(companyStreetField.getId());
if (companyName === selectedCompanyName && street && street !== ”) {
if (matchingStreets.indexOf(street) === -1) {
matchingStreets.push(street);
}
}
}
if (matchingStreets.length === 0) {
Utils.alertWithMessage(‘No Streets Found’, ‘No street addresses were found for ‘ + selectedCompanyName + ‘.’);
currentRecord.setFieldValue(streetField.getId(), ”);
return;
}
if (matchingStreets.length === 1) {
currentRecord.setFieldValue(streetField.getId(), matchingStreets[0]);
Utils.alertWithMessage(‘Street Set’, ‘The street address has been automatically set to: ‘ + matchingStreets[0]);
return;
}// Store references in variables that the callback can access
var targetRecord = currentRecord;
var targetStreetField = streetField;var prompterCallback = function(continued) {
if (continued) {
// Try to get the value using the global variable approach from your original code
if (typeof selectedStreet !== ‘undefined’ && selectedStreet) {
targetRecord.setFieldValue(targetStreetField.getId(), selectedStreet);
}
}
};var prompter = Prompter.new();
prompter.cancelButtonTitle = ‘Cancel’;
prompter.continueButtonTitle = ‘Select’;
prompter.addParameter(‘Select Street Address:’, ‘selectedStreet’, ‘popup’, matchingStreets);
prompter.show(‘Multiple Streets Found for ‘ + selectedCompanyName, prompterCallback);
}// Check if this is running in a Script Field context (automatic execution)
// vs being called from a button (manual execution)
if (typeof record !== ‘undefined’ && record) {
var companyField = form.getFieldNamed(‘Company’);
if (companyField) {
var companyValue = record.getFieldValue(companyField.getId());
// Only run if there’s actually a company selected
if (companyValue && companyValue !== ”) {
findAndSetStreet();
}
}
}September 18, 2025 at 5:35 AM #52980
Glen BParticipantsorry to the forum…wrong thread
-
This topic was modified 1 month, 2 weeks ago by
-
AuthorPosts
You must be logged in to reply to this topic.