You need to sign in to do that
Don't have an account?
Dutchy
Mass Update Opportunity - Code question
I'm trying to recode the s-control in Mass Update Opportunity (Available on the Appexchange) to something that does the same trick for a custom object called Price.
I receive the following error (in IE6) executing the script:
Line: 434
Char: 1
Error: 'sfname' is null or not an object
Code: 0
The piece of code where the error is generated is the following:
function load_data(opps,cols) {
var _data = []; // actualy an array of arrays ( 2D array)
if (!opps) return; // we caught the error in get_opps()
for ( var i = 0; i < opps.length; i++ ) {
_data[i] = [];
for (var j = 0; j< cols.length; j++ ) {
var daField = ( cols[j].sfname ? cols[j].sfname : cols[j].name );
if (daField==undefined) { daField = cols[j][1].sfname; }
var cel = opps[i].get(daField);
if ( cel && opps[i].getFieldDef(daField).type == 'date')
cel = cel.toString(); // turn dates into strings
_data[i].push( cel ); // fill the row
}
}
return _data;
}
var _data = []; // actualy an array of arrays ( 2D array)
if (!opps) return; // we caught the error in get_opps()
for ( var i = 0; i < opps.length; i++ ) {
_data[i] = [];
for (var j = 0; j< cols.length; j++ ) {
var daField = ( cols[j].sfname ? cols[j].sfname : cols[j].name );
if (daField==undefined) { daField = cols[j][1].sfname; }
var cel = opps[i].get(daField);
if ( cel && opps[i].getFieldDef(daField).type == 'date')
cel = cel.toString(); // turn dates into strings
_data[i].push( cel ); // fill the row
}
}
return _data;
}
When execuing the script, the turbo grid does not get filled with the data from the prices table. It does show the number of rows found in the top left corner. Can someone point me in the right direction or tell me where the fault can be? I'm completely lost . . .
Thanks,
:robotvery-happy:
porting this to a new object is doable, but not easy, good luck, I'd suggest using firefox and firebug as the debugger while you are working, then test in IE 6
Hi Ron,
Thanks a lot for you help!
I just had a comma in the wrong place :-))
Joost