Hi,
I’m having trouble with this method, and I think I have it pin-pointed down to the last line (not the commented out debugging line).
record.field always returns ‘undefined’.
var metrics = new Array('Pricing', 'Timeliness', 'Procedures', 'CustService','Quality','Billing','PO','Ontime');
var fields = new Array('pricingmetric','timelinessmetric','iwproceduresmetric','customerservicemetric','qualitymetric','billingaccuracymetric','purchaseordermetric','ontimedeliverymetric')
forms.VendorList.controller.loadAllRecords();
var foundsetsize = databaseManager.getFoundSetCount(forms.VendorList.foundset);
for(var i=1;i <=foundsetsize;i++)
{
var record = forms.VendorList.foundset.getRecord(i);
for(var j=0;j < metrics.length;j++)
{
var query = 'SELECT ROUND(AVG(CAST(rating as decimal(18,2))),2)*2 from surveyas where vendorid = ' + record.vendorid + ' and metric = \'' + metrics[j] + '\'';
var result = databaseManager.getDataSetByQuery(currentcontroller.getServerName(), query, null, 1);
var field = fields[j];
record.field = result.getValue(1,1);
// application.output(record.vendorid + '\t ' + metrics[j] + '\t ' + fields[j] + '\t ' + result.getValue(1,1) + '\t ' + record.field);
}
}
I thought I had this working a while ago, but it appears that it actually doesn’t do anything.
Thanks.