Hi all,
In a collection named “docjobs”, I have two columns (“docCoverageDay” and “paNpCoverageDay”) with numbers which I would like to add, and then insert the sum into a new column (“totalCoverageDay”).
The following code works to simply add 5 to the docCoverageDay:
export function docjobs_afterQuery(item,) {
//TODO:
item.totalCoverageDay = tcd(item.docCoverageDay);
return item;
}
function tcd(docCoverageDay, paNpCoverageDay) {
let tcd = docCoverageDay + 5;
return tcd;
//let tcd = docCoverageDay + paNpCoverageDay;
//return tcd;
}
but the following code does NOT work when trying to add the two columns together as desired:
export function docjobs_afterQuery(item,) {
//TODO:
item.totalCoverageDay = tcd(item.docCoverageDay);
return item;
}
function tcd(docCoverageDay, paNpCoverageDay) {
//let tcd = docCoverageDay + 5;
//return tcd;
let tcd = docCoverageDay + paNpCoverageDay;
return tcd;
}
I followed the basic idea of this tutorial but I’m a noob, with a noob problem, and am hoping for a noob solution (o:
thanks so much!
G