Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

Script action error

I have a few calcs to make on a form.
Some sub totals and a grant total. Rather than using many on change events to do the job I thought I would put it all in a script action and have the user press the script action to generate the totals.
I started off with a single calculation to see if it would work but it is failing straight away.
I get an error in the browser saying: Cannot read properties of null (reading 'get_item')

My script is

function(spContext, formContext, listColumnsInfo, currentItem, functionCallback) {
var TotalHours = 0
}

Thanks for sharing the script and requirement details above.

We believe you are using the script in the form event action. If so, please use below syntax to read the column value. Please refer sample article on this from https://www.crowcanyon.help/article/469/.

Read column value: var HourlyRate = _ccs_FormUI.fetchColumnValueUI("Child_x0020_Care_x0020_costs_x00");

To set the required value to the column, we can use return statement as shown below.
return sumChildCare;