Javascript Equivalent of Common Financial Formulas Found In Google Sheets

Continuing my work on RTU assets from yesterday, I found I needed to program some of the common formulas you see in Google Sheets into Javascript to be used in my Suitescript code. These common functions include: PV(rate, number_periods, payment_amount, future_value, end_or_beginning) FV(rate, number_periods, payment_amount, present_value, end_or_beginning) PMT(rate, number_periods, present_value, future_value, end_or_beginning) Each of the above functions comes in handy when trying to calculate the present value of an annuity, investment or mortgage. ...

October 5, 2023 · 7 min · 1481 words · Ryan Sheehy

Convert Paragraph To List Item In Google Docs Using Google App Script

How do you change a paragraph into a list item in Google Docs using Google App Script? To convert a paragraph into a list item using Google Docs identify first the paragraph you want to modify, then obtain the childIndex of where the paragraph is and finally insert the list item using insertListItem() function. Here’s how this process works going through step-by-step: Locate Paragraph To Change In your Google App Script code create a variable to capture the active document using DocumentApp.getActiveDocument() or open the document if you have the documentId using DocumentApp.openById(docId). ...

March 25, 2022 · 4 min · 795 words · Ryan Sheehy

Handlebars Must pass iterator to each (Error)

If you’re starting out with Handlebars and using it to create your HTML web pages, you may come across an oblique error message which may not make too much sense. One such error you may encounter returns the following response: throw new Exception(‘Must pass iterator to #each’) To solve this problem you need to locate within your Handlebars template code an {{#each}} call. For example, you may have something like this in your code where it is intended to loop through something and fetch the url and the link and output them as an anchor tag: ...

May 5, 2014 · 1 min · 182 words · Ryan Sheehy

cboxElement Missing Settings Object Solved!

I’ve fallen in love with the new Lightbox / Fancybox alternative Colorbox. Unfortunately though I spent half a day in frustration trying to get a simple YouTube clip displayed in an iframe popup. The errors I received in the console were: E r r o r : c b o x E l e m e n t m i s s i n g s e t t i n g s o b j e c t Which produced Access-Control-Allow-Origin errors or http protocol errors and a whole myriad of other warnings – just from a simple YouTube iframe setup. ...

August 24, 2013 · 2 min · 420 words · Ryan Sheehy

How To Create A Simple jQuery Background Image Slider

In one recent project I had to incorporate a traditional slider on the front page of a WordPress installation to showcase the range of products this site was selling. I was a little lazy and bought a popular package to accommodate the needs of my clients’ request. Unfortunately though, after tinkering around with it, I found it more of a nuisance than a help. Even after setting the package to use no styling it was still difficult to manipulate the object’s css properties to do what I wanted. ...

December 14, 2012 · 2 min · 339 words · Ryan Sheehy