All,
I am expending findOrders (OrderLookupServices) by adding
OrderAttribute and Payment as searchable entities.
The OrderAttribute works as expected
// search by child name
if (UtilValidate.isNotEmpty(childName)) {
dve.addMemberEntity("OA", "OrderAttribute");
dve.addAlias("OA", "attrValue");
dve.addViewLink("OH", "OA", Boolean.FALSE,
UtilMisc.toList(new ModelKeyMap("orderId", "orderId")));
paramList.add("attrValue=" + childName);
conditions.add(makeExpr("attrValue", childName));
}
but
// search by payment ref number
if (UtilValidate.isNotEmpty(paymentRefNum)) {
dve.addMemberEntity("PT", "Payment");
dve.addAlias("PT", "paymentRefNum");
dve.addViewLink("OP", "PT", Boolean.FALSE,
UtilMisc.toList(new ModelKeyMap("orderPaymentPreferenceId",
"paymentPreferenceId")));
paramList.add("paymentRefNum=" + paymentRefNum);
conditions.add(makeExpr("paymentRefNum", paymentRefNum));
}
returns message ..orderPaymentPreferenceId does not exist on the
Payment entity.
Note: this is the case where matching fields have different names.
I did not find any example in ofbiz that can help me to resolve this issue.
Jacek