# order.SetValuesFromCarrier shows error in Log

**URL:** https://forum.litium.com/t/order-setvaluesfromcarrier-shows-error-in-log/1546
**Category:** Questions
**Created:** [June 23, 2020, 5:23am UTC](https://forum.litium.com/t/order-setvaluesfromcarrier-shows-error-in-log/1546 "2020-06-23T05:23:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jiboy](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@Jiboy](https://forum.litium.com/u/Jiboy)
#### Post date: [June 23, 2020, 5:23am UTC](https://forum.litium.com/t/order-setvaluesfromcarrier-shows-error-in-log/1546/1 "2020-06-23T05:23:47Z")

</div>

I created a scheduled task to remove personal info from the order, using below code

```
foreach (var order in orders)
 {
var orderCarrier = order.GetAsCarrier(false, true, false, false, false, true);

orderCarrier.CustomerInfo.Address.ClearPersonalData();
orderCarrier.Deliveries[0].Address.ClearPersonalData();
orderCarrier.PaymentInfo[0].BillingAddress.ClearPersonalData();

order.SetValuesFromCarrier(orderCarrier, ModuleECommerce.Instance.AdminToken);
 }

  public static void ClearPersonalData(this AddressCarrier addressCarrier)
  {
if (addressCarrier == null) throw new ArgumentNullException("addressCarrier");

var emptyAddress = new AddressCarrier
{
	FirstName = string.Empty,
	LastName = string.Empty,
	Address1 = string.Empty,
	Address2 = string.Empty,
	Zip = addressCarrier.Zip,
	City = addressCarrier.City,
	Country = addressCarrier.Country
};

addressCarrier.SetValues(emptyAddress, addressCarrier.ID);
 }

```

This code is working as expected - it clearing user information form the order. But in the log it showing exceptions as below

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/f7442f2cecc816be4195d1f1adbabf71a70cc4b4.png)

---

<div class="post-metadata">

### Author: ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)
#### Post date: [July 6, 2020, 4:55pm UTC](https://forum.litium.com/t/order-setvaluesfromcarrier-shows-error-in-log/1546/2 "2020-07-06T16:55:39Z")

</div>

I think this is a bug in the platform, I can reproduce the same error if I create and edit an order directly from back office. Could you report it on Docs?

It seems like the db trigger for when an address is updated joins a bit too freely, so we end up with NULL as order id in the event table. Then when the event is processed it throws the exception.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)
#### Post date: [August 3, 2020, 4:55pm UTC](https://forum.litium.com/t/order-setvaluesfromcarrier-shows-error-in-log/1546/3 "2020-08-03T16:55:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
