I'm newbee, This time is about bisiness entity

Posted by OctavioOlguin on 19-Jan-2015 18:11

Greetings all !

I'm just trying this all new stuff for me...

I created a business entity (no rest expose) -dwTicket- , and have this program:


USING appserver.dwTicket FROM PROPATH.

DEFINE INPUT PARAMETER pJson1 AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER pResult AS LOGICAL NO-UNDO.

{"Appserver\dwticket.i"}

DEFINE VARIABLE lRetOK AS LOGICAL NO-UNDO.
DEFINE VARIABLE lJson AS LONGCHAR NO-UNDO.
DEFINE VARIABLE myTicket AS CLASS appserver.dwTicket NO-UNDO.

ASSIGN lJson = pJson1.

DEFINE VARIABLE lRetOK AS LOGICAL NO-UNDO.
DEFINE VARIABLE lJson AS LONGCHAR NO-UNDO.
DEFINE VARIABLE myTicket AS CLASS appserver.dwTicket NO-UNDO.

ASSIGN lJson = pJson1.

myTicket = NEW dwTicket().

/*MESSAGE pJson1.*/  /* when testing local calling, it showed the Json correctly */

lRetOK = DATASET dsdwTicket:READ-JSON("LONGCHAR", Ljson, "EMPTY").

/*MESSAGE lRetOK.*/         /* idem */

myTicket:CreatedwTicket(INPUT-OUTPUT dataset dsdwTicket).

I tought that the CreatedwTicket method, would create the record in the "real table in database" from the dataset.  as some testing I did before with other BEntity, created a record on db, or did I confused?

My question would be how can I make permanent on db the record I just got thru dwTicket dataset.

Am I correct, or did I managed to get confused about the whole concept?

Hope someone bear with me....

Thanks in advance.!!!

All Replies

Posted by OctavioOlguin on 19-Jan-2015 18:29

I forgot to mention, I tested with the parameter "APPEND" in the READ-JSON method,

also, with a create ttdwTicket before the calling of the method, both cases it won't helped.. :(

Posted by Paul Clare on 28-Jan-2015 08:25

Maybe I’m missing something, but as far as I can see from the post, you doesn’t say what the “CreatedwTicket” method does?  But either way, maybe the “Updating Data with ProDataSets” chapter of the “OpenEdge Development :ProDataSets” manual would help?

This thread is closed