You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Chen Xi <ch...@gmail.com> on 2007/12/29 10:47:26 UTC

Question related to simple method usage

Hi:
   I am currently involved developing project with ofbiz framework. In
create/update entity process, I adopt simple method to achieve. Simple
method is efficient, however I have some question to ask about the usage of
it.
   1. If I try to identify the duplicate record which is not the PK, can
someone provide the sample code which can check the duplicate record by
using simple method?
   2. Once I successfully create/update the record, I wish to create the
confirm message to inform user that the record has been successfully
created/updated. In the simple method syntax, how to apply this feature?

Regards
   Chen Xi

Re: Question related to simple method usage

Posted by BJ Freeman <bj...@free-man.net>.
simple methods is based on minilang.
http://docs.ofbiz.org/display/OFBIZ/Mini-Language+Guide
simple-methods as events or services.

1) look up simple methods that have the find-by. if the entity is
properly defined, there should not be duplicate records.

2)in orderreturnservices.xml
       <set field="responseMessage" value="Return Request
#${newEntity.returnId} was created successfully."/>
        <field-to-result field-name="responseMessage"
result-name="successMessage"/>



Chen Xi sent the following on 12/29/2007 1:47 AM:
> Hi:
>    I am currently involved developing project with ofbiz framework. In
> create/update entity process, I adopt simple method to achieve. Simple
> method is efficient, however I have some question to ask about the usage of
> it.
>    1. If I try to identify the duplicate record which is not the PK, can
> someone provide the sample code which can check the duplicate record by
> using simple method?
>    2. Once I successfully create/update the record, I wish to create the
> confirm message to inform user that the record has been successfully
> created/updated. In the simple method syntax, how to apply this feature?
> 
> Regards
>    Chen Xi
>