function resetOrder(catID,iteration) {
/*Grab all variables on a Catalog Item/Record Producer and reset the order value by the iteration
* catID: string [catalog item sys_id]
* iteration: int [5, 10, 100]
*/
var a = [];
var b = [];
var n = 0;
var x = 0;
var gr = new GlideRecord('item_option_new');
gr.addEncodedQuery('cat_item='+catID);
gr.orderBy('order');
gr.query();
while(gr.next()) {
a.push({
sys_id:gr.getUniqueValue(),
oldOrder:gr.getDisplayValue('order')
});
n++;
x = n*iteration;
b.push(x);
}
for(var i=0;i<a.length;i++) {
a[i].newOrder = b[i];
var v = new GlideRecord('item_option_new');
v.get(a[i].sys_id);
v.order = b[i];
v.update();
}
}
//resetOrder('02c78de49f331200d9011977677fcf76',100);