Hello Ritesh,

    You don't need to fetch all the records and then match the Primary key with 
the field value.
    you can use the "productId" you have from the form-fields to fetch a single 
record and then check if it is non-empty , and show an error message. 

example:---
   <entity-one entity-name="Product" value-field="product"/>
       <if-not-empty field="product">
           <add-error>
               <fail-property resource="ProductUiLabels" 
property="ProductIdAlreadyExists"/> 
           </add-error>
           <log level="info" 
message="${ProductUiLabels.ProductIdAlreadyExists}"/>
           <else>
               <check-id field="newEntity.productId"/>
           </else>
       </if-not-empty>
       <check-errors/>


Thanks and Regards
Sushil Mahajan.




----- Original Message -----
From: "Jacques Le Roux" <[email protected]>
To: [email protected]
Sent: Saturday, January 7, 2012 5:08:07 PM
Subject: Re: Ofbiz

To second Adrian,

Please use rather user ML for such questions, see why here :
http://cwiki.apache.org/confluence/display/OFBADMIN/Mailing+Lists#MailingLists-DesignanddevelopmentList:[email protected]

Thanks

Jacques

From: "Ritesh K Kaushik" <[email protected]>
> Hey,
> 
>    I found that service in ProductServices.xml, but can't find where they
> have iterated and checked for duplicate primary keys.
>  Please elaborate.
> 
> --
> View this message in context: 
> http://ofbiz.135035.n4.nabble.com/Ofbiz-tp4260861p4271979.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to