# Test Code
```
/** @var kDBItem $object */
$object = $event->getObject();
$object->SetError('CouponId', 'required');
```
# Test
# Login to adm.console
# Go to the {nav E-commerce > Discounts & Certificates} section, go to the Coupons tab
# Create coupon record with records on Items tab (enough to have one record, produced with "Entire Order" button)
# Edit coupons_event_handler.php - add test code in the OnBeforeItemCreate, after parent method call.
# Go to the {nav E-commerce > Discounts & Certificates} section, go to the Coupons tab
# Select some coupon record and press "Clone" toolbar button
# Go to the {nav Logs & Reports > System Log} section
# Confirm that in the system log in not present notice like this: "Undefined index: coup.-item";
# Remove test code from coupons_event_handler.php