Search Results for 'script'
Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Search › Search Results for 'script'
-
AuthorSearch Results
-
Glen Forister
ParticipantThanks for the syntax help. Yep, that works.
I notice an option to record a record shortcut. On an iPhone, what kind of shortcut would work that would be quicker than going into the “Run a Script” menu? The only thing I can think of is to go into another field and type “z”. Kinda lame and it leaves something to clean up, but easier than the full menu to script run.
Oops, in the manual, it looks like Menu Shortcut only works on the Mac, not the iPhone…
-
This reply was modified 2 years, 7 months ago by
Glen Forister.
Daniel Leu
ParticipantFirst, you got to remove following two lines to fix the error you got:
Reset_Stepper(); }Would you like to reset the two values at the same time? If yes, then it can be done with one script, otherwise two separate scripts.
Here is the template for two fields:
function Reset_Stepper() { var field1_id = 'fld-xxx1'; var field2_id = 'fld-xxx2'; record.setFieldValue(field1_id, 0); record.setFieldValue(field2_id, 0); document.saveAllChanges(); } Reset_Stepper();-
This reply was modified 2 years, 7 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksGlen Forister
ParticipantThanks for the confirmation.
Another question. I have two fields in this Form that has steppers. I assume I have to have two scripts which are housed in the Scripts Tab next to the Fields tab.
Attached is the error message.
Attachments:
You must be logged in to view attached files.Daniel Leu
ParticipantYes,
record.setFieldValue()takes action only on the current record. Here is the link to the JavaScript API documentation: https://www.tapforms.com/help-mac/5.3/en/topic/javascript-apiCheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksGlen Forister
ParticipantIf I’m guessing right, the “record.setFieldValue” will activate and change only one record of the Form?
I definitely don’t want to reset all the records, only the one I’m viewing.
I tried to look at Scripting docs I have and couldn’t find
record.setFieldValue defined to verify this.
I’m guessing setFieldValue is an action taken on a record.
June 5, 2023 at 2:51 PM #49547In reply to: Calculating future date
Daniel Leu
ParticipantHave a look at following response to a similar question: https://www.tapforms.com/forums/topic/how-to-increase-a-date-in-a-script/#post-49372
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksDaniel Leu
ParticipantYes, this can be done with a form script. You just need to replace
fld-xxxwith the field if of your stepper field.function Reset_Stepper() { var stepper_id = 'fld-xxx'; record.setFieldValue(stepper_id, 0); document.saveAllChanges(); } Reset_Stepper();-
This reply was modified 2 years, 7 months ago by
Daniel Leu.
-
This reply was modified 2 years, 7 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksGlen Forister
ParticipantThat method is not reliable and the Edit Field comment comes up. It only works if I’m shaky enough to get rapid touches.
Would a Scrip to it easier? No, I don’t have the time to learn Script – I tried, but I can’t dedicate enough time to it.
May 31, 2023 at 2:39 PM #49521In reply to: Layout Text – Object id
Daniel Leu
ParticipantOne benefit of exposing the API I could see is to use JavaScript code to build a custom layout by setting the coordinates, height, width, font settings, and so on. That would be an interesting idea too.
That’s something I’ve been thinking about. This would be a way to visually show the progress of actions (quoted, P.O. received, parts ordered, in production, shipped, invoiced, paid) like changing the color of certain graphic elements, like big arrows, squares, rectangles, etc.
-
This reply was modified 2 years, 7 months ago by
Daniel Leu.
-
This reply was modified 2 years, 7 months ago by
Brendan.
-
This reply was modified 2 years, 7 months ago by
Brendan.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksMay 31, 2023 at 11:15 AM #49517In reply to: Layout Text – Object id
Brendan
KeymasterOne benefit of exposing the API I could see is to use JavaScript code to build a custom layout by setting the coordinates, height, width, font settings, and so on. That would be an interesting idea too.
May 30, 2023 at 1:13 PM #49506In reply to: On the layout is not shown new value
Pavel
ParticipantHi Brendan,
I have this problem generally. Delete and replace field in layout is without effect.
Maybe I make some stupid mistake. Simply script is here:function Fill_Match() {
var ar_lv_r1_id = ‘fld-19384a3f4f1248ea82b16a9d4eee55e0’;
var ar_lv_r2_id = ‘fld-68464406010642928be2d4722d5b73fa’;
var ar_lv_r3_id = ‘fld-a09de8a68b6a4658bb030c677341a670’;
var ar_hv_r1_id = ‘fld-15db9eb1f8be4797a7f787ee90d40d04’;
var ar_hv_r2_id = ‘fld-47295e7cae1a46d6935848285ba24c82’;
var ar_hv_r3_id = ‘fld-37dc77cbaf2941a285c76be51f14fa03’;record.setFieldValue(ar_lv_r2_id, ‘XXXX’);
record.saveAllChanges;
console.log(record.getFieldValue(ar_lv_r2_id));
return;}
Fill_Match();
May 29, 2023 at 1:19 PM #49497In reply to: On the layout is not shown new value
Brendan
KeymasterAlso, you can have a Script Field just return its data and display it on a custom layout. You don’t have to set another field with the result just to display the result.
May 28, 2023 at 2:31 PM #49488Topic: Layout Text – Object id
in forum Script Talkalang
ParticipantText can be placed on a Form as part of the layout using the “A” icon labeled: “Add text to your layout”. Is there a way to get an object id of that text object. This would be to change the text via scripting as you do with regular form objects. Thank you.
-
This topic was modified 2 years, 8 months ago by
alang.
May 25, 2023 at 11:34 PM #49481In reply to: How to populate child form Popover
Brendan
KeymasterYou don’t need a separate field to contain the results of the Script field execution. You can just display the Script field directly because whatever you return from the Script will be displayed by that field. If the relationship field is the inverse of a One to Many (that is, a Link From Form field), then the Calculation field formula can also return that value and takes just a single double-click on the Formula Edit screen for the Calculation field.
May 25, 2023 at 10:38 PM #49480In reply to: How to populate child form Popover
alang
ParticipantI see. Thank you. On the form I am linking to are several fields that are themselves, “Link To Form”. So they, of course, are not available to display in the popover (or the left of the child form itself). I do need some combinations to appear in the popover. For example, the child form used to populate the popover, called Sources includes books titles. A field on Sources is Authors, which itself, is a “Link To Form” (to Authors) since a book might have several authors. What I want to appear in the popover populated by Sources would be, for example, a principle author (identified somehow in the authors form) plus the book title. So given what you have said, I am thinking that I need to utilize either a calculation field or a script field to extract on the sources form, for each record, book title plus author. The scripting would need to select which author. I would take that title plus author and place it in a regular text field on the form, Sources (the child form that will populate the popover). This plain text field, populated by the script with author-title, would then appear as a field to select for the popover. If I managed to make that clear, does it sound like I am headed down a reasonable path? Or does a better approach come to mind? Thank you.
-
This reply was modified 2 years, 7 months ago by
-
AuthorSearch Results