ARInvoiceSvc API trouble

Hey Josh,

Hopefully this helps, the update methods in Epicor sometimes require 2 datasets the first being the original InvcHead row with no modified values, then a second row InvcHead[1] with the modified dataset with RowMod = ‘U’.

So we are looking at for you

Dataset: {
   InvcHead: [ 
   { 
      *UNMODIFIED copy of the datarow*
   }, 
   {
      *MODIFIED copy of the datarow with RowMod U*
   }]
}

The reason this occurs as it appears that many standard Update methods in Epicor have logic to .compare() the datarows to find what fields have been modified. As there is only one datarow the method throws a ‘NullReferenceException’ error as it cannot make this comparison… There is no indication on the API help to tell you this, you just kinda have to know what is going on behind the curtain to figure out why.

In regards to the behaviour of UpdateExt, this method behaves differently as it has completely seperated logic which doesn’t make these .compare() errors. However it is wiser in some cases to use Update() or UpdateMaster() logic as often these have alot more logic to linked processes.

Again, this may not solve your issue, but it is certainly to me throwing red flags of an Update method that requires 2 datarows in the update method.