I'm trying to create an Order reference on Products when ever a new order is created. I have installed the "Order Reference" module and created an Order reference field on my product type.
Next I created the following rule:
- Rules Event: After saving a new commerce line item
Rules Conditions:
- Data comparison ( [commerce-line-item:type], Data value: Product )
- Data comparison ( [commerce-line-item..., Data value: NAME OF TYPE )
- Rules Action: Set data value [commerce-line-item..., Value: [commerce-line-item:order]
The above rule works fine as long as i limit the Order Reference field to 1 value, but as soon as it is set to multiple the rule breaks.. i get the following error for the action:
Error: The data type of the configured argument does not match the parameter's value requirement.
I'm new to the Rules module and a kind a lost here. Any help?
Below is the exported rule:
{
"rules_test_test_order_ref": {
"LABEL": "test test order ref",
"PLUGIN": "reaction rule",
"OWNER": "rules",
"REQUIRES": [
"rules",
"entity"
],
"ON": {
"commerce_line_item_insert": []
},
"IF": [
{
"data_is": {
"data": [
"commerce-line-item:type"
],
"value": "product"
}
},
{
"data_is": {
"data": [
"commerce-line-item:commerce-product:type"
],
"value": "iq_test_event"
}
}
],
"DO": [
{
"data_set": {
"data": [
"commerce-line-item:commerce-product:field-order-reference"
],
"value": [
"commerce-line-item:order"
]
}
}
]
}
}