Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Problem with this approach is that insideĀ OnBeforeItemUpdate, that is called during update the original field values of the object are not taken from database and default values are used. This way any code checking that field value was changed usingĀ $object->GetOriginalField method will always think that field is changed, but it's not true in majority of cases.

Solution

Use this code instead.

Code Block
$order_item->LoadFromHash($rec);
...
$order_item->Update();

Related Tasks