GenericValue productFeatureAppl = delegator.makeValue("ProductFeatureAppl",
UtilMisc.toMap("productId", product.getString("productId"), "productFeatureApplTypeId", "STANDARD_FEATURE"));
productFeatureAppl.put("fromDate", UtilDateTime.nowTimestamp());
for (String productFeatureId: selectedFeatures) {
productFeatureAppl.put("productFeatureId", productFeatureId);
productFeatureAppl.create();
}
//add standard features too
List<GenericValue> stdFeaturesAppls = EntityUtil.filterByDate(delegator.findByAnd("ProductFeatureAppl", UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "STANDARD_FEATURE")));
for (GenericValue stdFeaturesAppl: stdFeaturesAppls) {
stdFeaturesAppl.put("productId", product.getString("productId"));