svn commit: r1773213 - /ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1773213 - /ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml

Deepak Dixit-5
Author: deepak
Date: Thu Dec  8 11:03:26 2016
New Revision: 1773213

URL: http://svn.apache.org/viewvc?rev=1773213&view=rev
Log:
Improved:  Added user friendly error message in duplicateProduct service, if passed productId already exists than return uer friendly error message instead of entity exception.
   (OFBIZ-7402)
   
   Thanks Arvind and Padma for reporting the issue.

Modified:
    ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml

Modified: ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml?rev=1773213&r1=1773212&r2=1773213&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml (original)
+++ ofbiz/trunk/applications/product/minilang/product/product/ProductServices.xml Thu Dec  8 11:03:26 2016
@@ -167,6 +167,12 @@ under the License.
         <call-simple-method method-name="checkProductRelatedPermission"/>
         <set value="DELETE" field="checkAction"/>
         <call-simple-method method-name="checkProductRelatedPermission"/>
+        <entity-one entity-name="Product" value-field="dummyProduct">
+            <field-map field-name="productId" from-field="parameters.productId"/>
+        </entity-one>
+        <if-not-empty field="dummyProduct">
+            <add-error ><fail-property resource="CommonErrorUiLabels" property="CommonErrorDuplicateKey" /></add-error>
+        </if-not-empty>
         <check-errors/>
 
         <!-- look up the old product and clone it -->