try {
// String helloStudId = delegator.getNextSeqId("HelloStud"); // gets next available key for HelloPerson //Debug.logInfo("helloStudId = " + helloStudId, module); // prints to the console or console.log
            GenericValue helloStud = delegator.makeValue("HelloStud",
UtilMisc.toMap("helloStudId", helloStudId)); // create a GenericValue from ID we just got helloTest.setPKFields(context); // move primary key fields from input parameters to GenericValue

// here make sure that context must contain a key with same name as primary key of the Entity.

helloTest.setNonPKFields(context); // move non-primary key fields from input parameters to GenericValue delegator.create(helloStud); // store the generic value, ie persists it

Map result = ServiceUtil.returnSuccess(); // gets standard Map for successful service operations result.put("helloStudId", helloStudId); // puts output parameter into Map to return
            return result; // return Map
} catch (GenericEntityException ex) { // required if you use delegator in Java
            return ServiceUtil.returnError(ex.getMessage());
        }



--
Thanks and Regards
Sumit Pandit.
HotWaxMedia, Inc
http://www.hotwaxmedia.com

On Oct 22, 2008, at 11:12 AM, Vinayak Yadav wrote:

How to check the value of the ID field before storing the information.

Thanks

On Wed, Oct 22, 2008 at 2:33 AM, BJ Freeman <[EMAIL PROTECTED]> wrote:
you would use
    delegator.getNextSeqId("yourIDname");
to auto create.
other wise you need to check the value of the ID field before you store
the information.

Vinayak Yadav sent the following on 10/21/2008 4:17 AM:
Hi,
i an new in ofbiz
I have created one page for student information
It has two fields ID and Description
I don't want to auto generate ID
When we run the application it shows two text boxes to enter the
student id and description
but when we click on submit it gives an error
attached the hello3 example
Please help me

Thanks
Vinayak


Reply via email to