Search Results for 'script'
-
Search Results
-
Hi,
I have run into a problem extracting data from a Link to Form-field with a One to Many-relationship.
I usually use Many to Many-relationships in my database, which is probably why I’ve never had this problem before. What I am trying to do is use a script to extract data from a certain field in a linked form and display it in a script field, because I can format that to match my layout.
What I usually do with a Many to Many-related form is this:
function Collection_Series() {var embroidery_collections_id = ‘fld-9be76f6c90334bbbaa0e2c4dc3556358’;
var collection_series_name_id = ‘fld-40cb304839354352875dcaefb9403a2f’;var childs = record.getFieldValue(embroidery_collections_id);
var child_names = [];
for (child of childs){
child_names.push(child.getFieldValue(collection_series_name_id));
}//child_names.sort();
var done = child_names.join(‘, ‘);
console.log(done);return (done);
}
Collection_Series();`
Now, I am aware that this script is designed for multiple values to be returned, from multiple linked records. But this should also work for a single record from a One to Many-relationship…
But it doesn’t work. I should say that I am using this on the reverse relationship variable, so basically on the “One”-side of the One to Many-relationship.
Can anyone help me perhaps with a different method to extract that value from the linked record?
Like I said, it is simply an aesthetic problem; I don’t like the look of Link to Form-Fields in a layout and I really just want to display the value and not the control elements, because I will be linking records from. the other side.I might as well just use a Many to Many-relationship, but I feel like there should be a way to do what I am trying to do with a One to Many-relationship as well.
Thanks in advance!
I think this could be a tough feature to implement, but it would be cool if we could sort a subset of records in a link-to-form scenario. The manual sorting works for records in an entire form, but will not do anything if you drill down via a link to form field.
So for example, you have a form called “Projects” then have a child form “Tasks” via a link-to (one to many relationship) field. By clicking a task in the Link To field in the project form layout it will go to the task, and show all the other tasks related to that project.
It would be very useful to be able to manually sort these tasks within this collection of records. Right now I use scripts to promote / demote the tasks with a numeric “order” field which works, but a manual sort would be much easier to implement going forward. :)
Topic: Script Shortcut Not Working
Has anyone noticed in TFP that setting a menu shortcut for a script doesn’t work? I’ve tried different shortcuts and made sure that it’s not sharing a shortcut with another menu item. I feel it might be a macOS Tahoe thing? I’ve included a screenshot to show what the shortcuts looks like.
Topic: Totally lost on script
I have two forms
Parent form- Property. Fields PropId and OwnerName. One to many link to child.
Child file Payments. Fields PaymentFor and PayeeI would like to copy. PropId -> PaymentFor. and OwnerName -> Payee
automatically when the child record is created.I have lloked at other posts in this forum and I just don’t get it.
Can you help me get started on this?Prompting for input seems to be broken (on iPadOS) on 1.0.12
This super basic test-script works on my old iPad running 1.0.10, but seems to exit as soon as it hits the prompt on my current iPad running 1.0.12function Script() {
var text_field_id = ‘fld-fbb43c119bb24512a7599b04d335d3b6’;
var check_mark_id = ‘fld-c164df88f01746b4a476462fd89ab696’;
var check_mark = record.getFieldValue(check_mark_id);if (!check_mark) {
return;
}var callbackFunction = function() {
console.log(value_1);
record.setFieldValue(text_field_id, value_1);
record.setFieldValue(check_mark_id, false);
};let prompter = Prompter.new();
prompter.addParameter(‘Label 1’, ‘value_1’, ‘text’)
.show(‘Message prompt’, callbackFunction);
}Script();
Backup of the document attached just in case
Topic: Script Issue with Update
After updating to iOS Tap Forms version 1.0.12, I’m unable to add records with a script. The script still works on the macOS version, though I haven’t updated to 1.0.13, yet.