SolutionModel Table Calculation

I have a jsTable (sv_inmem/temp) attached to a form. I am creating this table from a dataset. I was wondering if there is a way to run a calculation on a column in this temp_ table like any other table. Currently I am having to loop through the dataset and make any calculation before I convert it to a URI and attach it to the form. I am trying to do as much through the foundset as possible without having to manipulate the dataset manually in the code.

for (var k = 1; k<=_dsParts.getMaxRowIndex(); k++) {
if (_dsParts.getValue(k,16) == 'true') {
	_dsParts.setValue(k,16,'<html><img src="media:///NotPostable.png"></html>')
} else {
	_dsParts.setValue(k,16,'')
}
}
var uri = _dsParts.createDataSource('workOrderParts'); 
var _jsForm = solutionModel.getForm('formName_frm')
 _jsForm.dataSource = uri
 var _success = forms.formName_frm.controller.recreateUI();

Unfortunately it is currently not possible to create new calculations with the solutionModel.

Please create a feature request in the Support System.

I will do that. Thanks. :)

I saw this was fixed today with the release of 5.0.1: [fix] 255057 Setting value in dataset using the named column doesn’t work. Having the ability to set a value using the column name would make my looping through datasets much easier to read. But, I’m not sure how to use this.

Currently I have:

_dsParts.setValue(k,10,'<html><img src="media:///NoCost.png"></html>')

I tried naming the column instead with no results:

_dsParts.setValue(k,"NOCOST",'<html><img src="media:///NoCost.png"></html>')

Am I interpreting the fix incorrectly, or is my syntax incorrect?

Bobby,

This fix means you can now assign a value direct in the dataset:

_dsParts.NOCOST = '<html><img src="media:///NoCost.png"></html>'

It will set the value in column named NOCOST of row _dsParts.rowIndex

Rob

I tested this and it is a great improvement from the get/setValue! Previously I was dealing with 30-40+ columns and having to count over to figure out which column I needed to reference. Thanks! :D