Ofbiz

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

Ofbiz

Ritesh K Kaushik
If we enter a duplicate Primary key in Ofbiz then it gives a long error message, is there any way to customize those messages.
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz

Adrian Crum-3
This question should be asked on the user mailing list.

The best approach is to do a find on the primary key, and if a value is
found, return a user-friendly error message.

-Adrian

On 1/4/2012 11:04 AM, Ritesh K Kaushik wrote:
> If we enter a duplicate Primary key in Ofbiz then it gives a long error
> message, is there any way to customize those messages.
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Ofbiz-tp4260861p4260861.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz

Sascha Rodekamp-3
Hey,
you could check the createProduct service. There is a small block where this check is done and a friendly message, in case of a duplicate primary key, will returned.

Best Regards

Am 04.01.2012 um 20:37 schrieb Adrian Crum <[hidden email]>:

> This question should be asked on the user mailing list.
>
> The best approach is to do a find on the primary key, and if a value is found, return a user-friendly error message.
>
> -Adrian
>
> On 1/4/2012 11:04 AM, Ritesh K Kaushik wrote:
>> If we enter a duplicate Primary key in Ofbiz then it gives a long error
>> message, is there any way to customize those messages.
>>
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.com/Ofbiz-tp4260861p4260861.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz

Ritesh K Kaushik
In reply to this post by Adrian Crum-3
Hi Adrian ,

   If i am using my java class, i can iterate, but if there service is used i don't know how to iterate.Can u pls.
   tell me how to do it.
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz

Ritesh K Kaushik
In reply to this post by Sascha Rodekamp-3
Hey,

    I found that service in ProductServices.xml, but can't find where they have iterated and checked for duplicate primary keys.
  Please elaborate.
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz

Jacques Le Roux
Administrator
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:dev@...

Thanks

Jacques

From: "Ritesh K Kaushik" <[hidden email]>
> 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 | Threaded
Open this post in threaded view
|

Re: Ofbiz

Sushil Mahajan-2

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" <[hidden email]>
To: [hidden email]
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:dev@...

Thanks

Jacques

From: "Ritesh K Kaushik" <[hidden email]>
> 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.