function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DutchyDutchy 

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;
}
 
 
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:
Ron HessRon Hess
sfname is a property of the cols array, you need to make sure this array is initialized, it's up near the top of the code, called 'columns' i believe.

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




DutchyDutchy

Hi Ron,

Thanks a lot for you help!

I just had a comma in the wrong place :-))

 

Joost