Are the print statements showing the correct output?



One thing you could try is to add .toString() at the end of "itemObj.CustMaterialNumber=ritmRec.number". This is usually the first thing I'll do when I see this strange behavior. I believe it has something to do with how javascript handles pointers and objects but simply adding .toString() fixes a strangely high number of issues when dealing with GlideRecord data.