For the longest time, this has not worked properly. Sometimes the value gets set, other times it does not. I just did a bunch of testing and can’t understand this at all.
Trying to calculate the total cost of all lines and then take a percentage of that value to pop into the “Landed Cost Accrual” field. Each time I do this, all other fields set but this one doesn’t. I’ve also tried to use nlapiSubmitField(‘itemreceipt’, recID, ‘landedcostamount1’, caclCost); and that doesn’t work. HOWEVER, it works when I do it through the console. It’s almost as if something runs on afterSubmit that wipes this out.
Right now my only away to accomplish this is through a scheduled scrip to through a mass update. This isn’t ideal, because we would receive parts in and then send them out 10 minutes later. The mass update only runs once a day right now.
Does anyone know if this is a noted issue? Should I give up on trying to use afterSubmit events, or is there something else I could be doing? The only other thing I can think of would be to have the afterSubmit event trigger a scheduled script that runs after the Item Receipt is fully submitted.
This is a cached copy. Click here to see the original post.