HELP NEEDED - Google Spreadsheet script

StewartR

Suspended / Banned
Messages
11,513
Name
Stewart
Edit My Images
Yes
Are there any people out there who are experts in Google Apps scripts? We have one which seems to have broken and for the life of me I can't debug it.

Here's a bit of simple background to help you gauge the complexity of the issue. We have a big Google spreadsheet which keeps track of all our lens hires. It looks like this:

LFH_availability_1.PNG


You can see each hire represented as a sequence of values: D for dispatch, T for transit, 1,2,3 etc. for the hire days, T for transit, R for return. The comments on the dispatch cells identify the customer and order number.

We have a couple of simple scripts to automate the process of adding new hires to the chart. They pop up a simple form to collect the key data and then writes a sequence of values (D,T,1,2,3,...,T,R) into the spreadsheet. The form looks like this:

LFH_availability_2.PNG


It's worked quite happily for about a year, but yesterday it just started misbehaving.

You can see that, when it is initiated, the form detects the currently active cell of the spreadsheet and works out which date and which lens that corresponds to. That clearly works.

When the form is completed and 'OK' is pressed, it triggers another script which constructs an array of values (D,T,1,2,3,...,T,R) and pastes them into the spreadsheet starting at the chosen cell. That used to work, but now it doesn't. Instead, it always pastes the values into a series of cells starting at A1.

What baffles me is that the script hasn't been changed.

What also baffles me is that the syntax for detecting which cell to start with is the same in both scripts (the script which displays the form and the script which processes the inputs). It clearly works in the first script but apparently doesn't work in the second.

I originally wrote the scripts. But I'm not a programmer - I just cobbled them together following a sort of how-to-build-a-simple-UI article I found on Google's support website. So I'm really out of my depth here.

Any ideas? If you think you might be able to help, please let me know and I can make more details available. I'm out of the office now until mid-afternoon, but I'll get back to you ASAP.
 
Back
Top