Tap Forms app icon half
Tap Forms Forum text image
Blue gradient background

Exchange tips and ideas with the Tap Forms community

Search Results for 'script'

Viewing 15 results - 1,891 through 1,905 (of 2,952 total)
  • Author
    Search Results
  • #40531

    In reply to: Invoicing

    Vera Milosavich
    Participant

    Can I get help with the Child Records Loop snippet — or whatever it takes to generate my invoices & summary reports? I have zero clue how to use javascript.

    #40524

    In reply to: Add to Calendar

    Alejandro
    Participant

    HI Brendan!
    thank you!
    I’m going to store the eventID in other fields of that form. Is like A600F804-4729-48FC-906B-E85ED7ACC874:117BCA7E-0500-457C-A101-DB830C1E3EE0

    My idea is to have a special calendar for TF, and create events every time I see a Movie for example.
    Then I can Visualise on my calendar when I saw movies. And also I add the link like:
    tapformz://record/view/db-d604320e10394cd582b9b345b76a8f97/frm-b1e2b68a569c4dbe9e468c31f3a62188/rec-XXXXXXXXXXX
    to get the details.

    But If I need to reset my calendar I want to delete all days for example.

    By the way, is there a way to run a script and the output (like console.log) save it to a file?

    Kind regards
    Alejandro

    #40516
    Daniel Leu
    Participant

    Now I see it….

    Brendan, double-clicking on ‘Get total of field from form’ snippet returns

    `var field-name_id = ‘field-id’;
    var total = form.getTotalOfField(field-name_id);1

    But the - is not a valid character to be used in a Javascript variable name.

    The same applies to the other three Get... snippets.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #40514
    Wolfgang
    Participant

    Hi Daniel,
    that’s exactly what I wanted to say.
    In Tap Forms in the script field the variable of the formula “get total of field from form” is displayed with “-” and always gave me an error message.
    That’s why I removed the “-” and used “fieldname” or “field_name” …

    #40507
    Brendan
    Keymaster

    Ok, well that should work.

    And sorry, for some reason I didn’t see your attachments before.

    Did you return the values later on in your script? Or did you just define the vars?

    #40501
    Brendan
    Keymaster

    Can you post your script?

    #40498
    Wolfgang
    Participant

    Thank you for the info. But no result is shown …
    I use 2 field scripts (see screenshots).
    – one with the line you mentioned above
    – one using the formula of the list in the script window
    No entries in the fields!

    Wolfgang

    Attachments:
    You must be logged in to view attached files.
    #40496

    In reply to: Invoicing

    Brendan
    Keymaster

    Hi Vera,

    Ya, building a layout system that handles a fully customizable rows with grouping and summarizing is a ton of work. It is something I want to eventually do though.

    Tap Forms can do multi-page reports by linking custom layouts together. But each custom layout can only be one page tall. But that does allow you to have lots of fields with complex layouts spread over multiple pages per record.

    You could actually write a script that generated the summary data for you from your Link to Form (or Table) fields. You could even use a separate Table field to store the summary records and use that on your Invoice. So your Invoice could have the Table field (or Link to Form field) with all the details, plus a separate Table field to store the summary results.

    You would have to use the Child Records Loop snippet as Sam suggested to loop through your child records accumulating a total for a field. I should really add the getTotalOfField() function to the record object so you could ask a Table field for a total of a specific sub-field.

    #40495
    Brendan
    Keymaster

    Hi Wolfgang,

    Sure. You can get that.

    In the JavaScript API docs there’s this function:

    var total = form.getTotalOfField(field_id);

    That’ll do it. It returns the same value as you see displayed at the bottom of the records list view.

    Hope that’s what you’re looking for.

    Thanks!

    Brendan

    #40486

    In reply to: Invoicing

    Sam Moffatt
    Participant

    Assuming you’ve set up your invoices with a link to form or table field in them for the individual line items, you can generate a script field that calculate what you need. The “Child records loop” snippet is a good place to start, you can use that to get the values of the child records and do what ever calculation you need.

    I think one of the areas that Tap Forms is a little limited in is the reporting functionality with respect to nested elements. The custom layouts work well for single records and setting up simple labels but when it comes to building a single layout that could flow to multiple pages naturally based on child content, that just isn’t a thing. Getting something like that right in a generic sense is hard and would require building a new layout engine from scratch, it’s not the sort of thing I’ve seen outside of the expensive databasing products. I’ve spent a lot of quality time with page layout platforms and it can quickly get out of hand when you start to drill down into formatting, fitting items on pages, how you handle overflowing subcontent (e.g. should a child record be split apart or should it always be together?) and issues around odd/even page formatting. Very quickly printing things becomes…interesting.

    #40482

    In reply to: Invoicing

    Vera Milosavich
    Participant

    BTW: I did NOT mean to imply TapForms is NOT excellent. So far it is the best of the home- and small-business use database I’ve tried. But summaries are critical for me.

    Maybe I’m approaching summaries in the wrong way…

    I’m still trying to figure out how a lot of the fields and properties work. Is there a way to create a separate field that can display a sum based on matching criteria, like SUMIF() and SUMIFS() in Excel or Numbers? If you could implement those kinds of formulas, my problem might be solved!

    Or is it possible to collapse the line items of a summary when displayed on another invoice — or even in the spreadsheet view because sometimes I really ONLY want to see the subtotals and not every transaction.

    Or is there a way to copy/paste group summaries so I can paste them into an invoice? It would be clunky, but it’s better than typing it in.

    Is any of this something a script can do NOW? If so, maybe I can get help with that down the line. I’m not excited to learn scripting, but if I can solve this one problem, I think I’ll be over the transition hump.

    Thanks!

    #40479
    Sam Moffatt
    Participant

    Just thought I’d post over here that Humble Bundle currently have a sale a selection of books from the O’Reilly Definitive Guide series. At the $1 tier is the Javascript book and I know folks have mentioned wanting to pick up more Javascript. I’ve not personally read this book but in general I’ve found O’Reilly’s books to be well written and I have a good selection of their books. At a dollar, that also helps charity too, I think it is at least worth a look to see.

    #40474

    In reply to: Compound calculations?

    Vera Milosavich
    Participant

    Thank you for the info. I did look through the manual but either I overlooked that or misunderstood the use.

    I have no doubt that scripts can do much more, but I can’t devote the amount of time to learning this for just a handful of uses.

    #40468
    Brendan
    Keymaster

    Hi Rainer,

    Take a look at your post above again. I added the ` code ` back ticks to show you what your script looks like formatted nicely. Sam and Daniel were just trying to help so that it’s easier to read your code.

    Here’s an example of a single line piece of code with back ticks:

    var first_name_id = 'fld-......';

    and here’s a multi-line one:

    var first_name_id = fld-.....';
    var first_name = record.getFieldValue(first_name_id);

    We’re all here to help and share ideas.

    Thanks,

    Brendan

    #40462

    In reply to: Compound calculations?

    Brendan
    Keymaster

    Hi Vera,

    With an IF() expression, you can use & for AND and ~ for OR.

    so IF((A=B ~ C=D & E=F); X; Y)

    The operators are mentioned in the Calculations topic in the online user manual:

    https://www.tapforms.com/help-mac/5.3/en/topic/calculation

    But for complex operations I usually prefer to use a Script Field instead of a Calculation Field. You can do so much more with Script Fields.

Viewing 15 results - 1,891 through 1,905 (of 2,952 total)