I tried following code but it is not working. It is giving error while
compiling.
Please Help Us.

Thanks


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());

       }

Reply via email to