Skip to main content

PeopleSoft REST services

PeopleSoft Rest Service
 

 

Here is a step by step example of how to create a REST service in PeopleSoft. 

The first example passes one row of data via the URL. The response includes multiple po lines. 

The second example passes JSON in the body with no parameters in the URL. The response is one row per row in the request.

 

1)    Create template document for inbound parameter(s) (the request).

1)    One or more element names.

2)    Create a view record of the outbound data (the response).

3)    Create template document.

1)    Element names, Collections and Compounds.

2)    Map the document elements to fields in your view

4)    Link messages to document

5)    Create your response message which structures your response.

6)    Create a REST Service

7)    Create your Service Operation

8)    Create your service operation handler application package. This is the PeopleCode that will trigger and will respond to the incoming request and return something useful to the client.

9)    Link your service operation handler to the application class.

10)  Setup the security of the web service.

11) Bonus: Pass JSON in the body example.

 

 

The REST service will be invoked by a URL like this:

https://peoplesoft.domain.com:9999/PSIGW/RESTListeningConnector/PSFT_EP/FS_FS_PO.v1/?PO_ID=1234567890


The ? begins the parameter list. In our case there is one. If you were to create multiple parameters each would be separated by an &. Like this:

https://peoplesoft.domain.com:9999/PSIGW/RESTListeningConnector/PSFT_EP/FS_FS_PO.v1/?BUSINESS_UNIT=POBU&PO_ID=1234567890

There are several pieces to the URL:


peoplesoft.domain.com - This is the hostname. It is not accessible to the internet.

PSIGW - Standard Integration Gateway path

RESTListeningConnector - REST connector that accepts REST web services.

PSFT_EP - The node name that I am directing this service to. This will differ based on your installation.

FS_FS_FS.v1 - The service operation name and version we will create

BUSINESS_UNIT and PO_ID - are the parameters.

  • Build a document object that will capture all the parameters that may be sent inbound to your web service. This is the request.
  • We are building parameters in this document. The parameter will be in the URL. So, we are only passing 1 row of data. 
    • The document can only contain primitive elements and collection elements.
    • The document cannot contain any imports (compounds) or compound elements. In this example there is one parameter: PO_ID. It is created as a document primitive (blue star).
Build view of the data to be sent in response
Not required to build a view; it’s useful to retrieve the data for the response



Build a document object that will capture the parameters that will be sent outbound from your web service; this is the response.

Create a message that will be used to return the XML or JSON from the service

In this example, we create a collection for multiple lines; Note: You need a collection if returning multiple rows.

When we are done creating the lines this is what it will look like.
Add a collection peer (green dots)
Add a compound peer (Red connected dots)
Add primitive peers (blue star) for each field in your response. Define the type. 
The detail steps are below






1st Create a document for the line fields
First we create a document for the line fields
1st Time Give Package a Name. In our case DCP_DocumentPackage_PO
Give the Document a name: DCP_FS_PO_LN
And a Version V1
We are building from the inside out. Details 1st then header.
We are going to add this document to a collection.
Again add a primitive child and primitive peers for each field for the lines in the response.
Choose a type (decimal) for each and a length (10 and in this case also the number of decimals 4)




Map fields to view 
Mapping PeopleSoft records and fields to documents is optional.
Usually done to populate a rowset using a document; rowset is not used in our example
Enter the view you created in the record name.
Chose the field that matches your primitive.





Note the XML element and JSON tags; your response can be either





Create a collection peer
Create a new document for the same package
Add a Collection Peer (Green dots).
Add Compound Peer (Connected red dots) to add child document


The Package will default
Enter the document
Enter the version
Search
Select your result




Then create header
We’ve created the lines
Now create the header.
Add Primitive peers for each field (blue stars).




Then add collection for lines. This allows for multiple rows.

Add Compound Peer (connected red dots) to add child document much like we added PO_LINE_LIST – DCP_FS_PO_LN


Click the connected red dots and this appears. 
Document DCP_PO_LINES
Click Search and chose the results


End result will look like this.



Create message and map to document

Build a message object based on the document template built earlier

PeopleTools > Integration Broker > Integration Setup > Messages
Choose Add New Message
Choose Type = “Document”
Enter message name and then input the package document package and name
Do this for both the request and the response

    This example is for the request DCP_FS_PO_ID.
    You’ll need to do it for the response too DCP_FS_PO.





Create the service

  • Give it a name, be sure REST Service is checked 
  • click Add.



Service Operation

Create the service operation

Give the Service Operation a Name
Choose the REST Method. In this example, “Post” is chosen; Note: This will be appended to the name
Click Save
Click Add






Create the service operation
Add parameters for the template
Add the Messages (Documents) for your request, response and optionally fault (error)
    These are the message we created which are tied to the documents we created.
This is why we link the message to the document, so we can put the message here
Choose the content type.
    Note: I chose the content type application/JSON because I want my response to be JSON.



Create the Application Package:Application Class. This is the code that will populate the response.



import PS_PT:Integration:IRequestHandler;
class DCP_FS_PO_POST implements PS_PT:Integration:IRequestHandler  
method OnRequest(&_MSG As Message) Returns Message;
method OnError(&pRequestMsg As Message) Returns string; end-class;


method OnRequest
   /+ &_MSG as Message +/
   /+ Returns Message +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnRequest +/
   Local Message &returnMsg;
   Local Document &returnDoc;
   Local Compound &returnCom, &returnCom2, &aComLn;
   Local Collection &returnColl;
   Local boolean &ret;
   Local DocumentKey &docKey;
   Local Primitive ≺
   Local string &sCriteria;      

/* This is the view mapped to the document */
Local Record &POVndrRec = CreateRecord(Record.DCP_PO_REST_VW)
/* Build the select */
&POVndrRec.PO_ID.Value = &PO_id;
&sCriteria = " WHERE PO_ID = '" | &POVndrRec.PO_ID.Value | "'";
Local string &POVndrSQL_Str = "%SelectAll(:1)" | &sCriteria;

   
   /* Populate document with inbound message values from URI*/
   Local Document &PODoc = &_MSG.GetURIDocument();
   /* This would retrieve the http content body as a string. Normally either JSON or XML*/
   
   /* Get the PO id from the inbound document */
   Local string &PO_id = &PODoc.GetElement("PO_ID").value;
   
   Evaluate &_MSG.HTTPMethod
   When = %IntBroker_HTTP_POST
      
      /* Fetch PO and Vendor details from DCP_PO_REST_VW */
      Local Record &POVndrRec = CreateRecord(Record.DCP_PO_REST_VW);
      /* Build the select */
      &POVndrRec.PO_ID.Value = &PO_id;
      &sCriteria = " WHERE PO_ID = '" | &POVndrRec.PO_ID.Value | "'";
      Local string &POVndrSQL_Str = "%SelectAll(:1)" | &sCriteria;
      rem MessageBox(0, "", 0, 0, "POVndrSQL = " | &POVndrSQL_Str);
      
      Local SQL &SQL_PO_Vndr = CreateSQL(&POVndrSQL_Str, &POVndrRec);
      
      /*Construct response message */
      &returnMsg = CreateMessage(Operation.DCP_FS_PO_POST, %IntBroker_Response);
      &returnDoc = &returnMsg.GetDocument();
      &returnCom = &returnDoc.DocumentElement;
      
      /*Get 1st Row (for header ) */
      
      Local boolean &Found = &SQL_PO_Vndr.Fetch(&POVndrRec);
      
      &pr = &returnCom.GetPropertyByName("BUSINESS_UNIT");
      &pr.Value = &POVndrRec.BUSINESS_UNIT.Value;
      &pr = &returnCom.GetPropertyByName("PO_ID");
      &pr.Value = &POVndrRec.PO_ID.Value;
      &pr = &returnCom.GetPropertyByName("PO_STATUS");
      &pr.Value = &POVndrRec.PO_STATUS.Value;
      &pr = &returnCom.GetPropertyByName("VENDOR_ID");
      &pr.Value = &POVndrRec.VENDOR_ID.Value;
      &pr = &returnCom.GetPropertyByName("NAME1");
      &pr.Value = &POVndrRec.NAME1.Value;
      &pr = &returnCom.GetPropertyByName("NAME2");
      &pr.Value = &POVndrRec.NAME2.Value;
      &pr = &returnCom.GetPropertyByName("VENDOR_CLASS");
      &pr.Value = &POVndrRec.VENDOR_CLASS.Value;
      /* Could return multiple rows */
      While (&Found)
         
         /* Get the child compound element */
         &returnCom2 = &returnCom.GetPropertyByName("DCP_PO_LINES");
         /* Get the child collection element */
         &returnColl = &returnCom2.GetPropertyByName("PO_LINES_LIST");
         /*create a new compound (DCP_FS_PO_LN) and set the values of each primitive*/
         &aComLn = &returnColl.CreateItem();
         
         &pr = &aComLn.GetPropertyByName("QTY_OPEN");
         &pr.Value = &POVndrRec.QTY.Value;
         &pr = &aComLn.GetPropertyByName("INV_ITEM_ID"); /* DCP Part # */
         &pr.Value = &POVndrRec.INV_ITEM_ID.Value;
         &pr = &aComLn.GetPropertyByName("DESCR254_MIXED");
         &pr.Value = &POVndrRec.DESCR254_MIXED.Value;
         &pr = &aComLn.GetPropertyByName("VNDR_CATALOG_ID"); /* Vendor Part */
         &pr.Value = &POVndrRec.VNDR_CATALOG_ID.Value;
         &pr = &aComLn.GetPropertyByName("OPEN_AMT");
         &pr.Value = &POVndrRec.OPEN_AMT.Value;
         &pr = &aComLn.GetPropertyByName("MERCHANDISE_AMT"); /* Line Total */
         &pr.Value = &POVndrRec.MERCHANDISE_AMT.Value;
         &pr = &aComLn.GetPropertyByName("PRICE_PO"); /*Item Price */
         &pr.Value = &POVndrRec.PRICE_PO.Value;
         &pr = &aComLn.GetPropertyByName("DEPTID"); /*RC Code */
         &pr.Value = &POVndrRec.DEPTID.Value;
         &pr = &aComLn.GetPropertyByName("LINE_NBR");
         &pr.Value = &POVndrRec.LINE_NBR.Value;
         &pr = &aComLn.GetPropertyByName("SCHED_NBR");
         &pr.Value = &POVndrRec.SCHED_NBR.Value;
         &pr = &aComLn.GetPropertyByName("UNIT_OF_MEASURE");
         &pr.Value = &POVndrRec.UNIT_OF_MEASURE.Value;
         /* Concatenate multiple rows of the child entity and maintain the one to many relationship */
         &ret = &returnColl.AppendItem(&aComLn);
         &Found = &SQL_PO_Vndr.Fetch(&POVndrRec)
      End-While;
      
   When-Other
      /* throw error conditin */
      throw CreateException( - 1, - 1, "Invalid call %1", String(&_MSG.HTTPMethod));
      
   End-Evaluate;
   Return &returnMsg;
   
end-method;


method OnError
   /+ &pRequestMsg as Message +/
   /+ Returns String +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnError +/
   
   
   Local Message &returnMsg;
   Local Document &returnDoc;
   Local Compound &returnCom;
   Local Document &PODoc = &pRequestMsg.GetURIDocument();
   
   Local string &PO_id = &PODoc.GetElement("PO_ID").value;
   &returnMsg = CreateMessage(Operation.DCP_FS_PO_POST, %IntBroker_Fault);
   &returnDoc = &returnMsg.GetDocument();
   &returnCom = &returnDoc.DocumentElement;
   &returnCom.GetPropertyByName("PO_ID").value = &PO_id;
   &returnCom.GetPropertyByName("errorMsg").value = &pRequestMsg.IBException.ToString();
   rem Return &returnDoc.GenXmlString();
   Return &returnDoc.GenJsonString();
   
end-method;

Link the service operation Handler to the class


Setup Security





  • In the previous example the data was passed in the URL.
    • This only passes one row of data.
  • What if you need to pass multiple rows?
    • This can be done by passing JSON in the body of the message.
  • Setup the URL with a ? But no parameters




Setup Request Message (Document)

Note Element Name (Compound peer under collection peer)




Get json string from the content

  Local string &jsonString = &requestMsg.GetContentString();

GenJsonString didn’t work well. It returned garbage and was inconsistent.

   &requestDoc = &requestMsg.GetDocument();

   &requestCom = &requestDoc.DocumentElement;

    Local string &jsonString = &requestDoc.GenJsonString();



JSON Body POSTMAN test





Comments

  1. Thank you very much for this... I saw it on quest and had to refind it now... Crazy that there is no real documention for this.. Especially coming in ...
    One thing when I created my service the ID was not displayed at the end.. like yours "FS_FS_PO.v1/" it stops at the DB.. Did I miss some setup..

    https://peoplesoft.domain.com:9999/PSIGW/RESTListeningConnector/PSFT_EP/FS_FS_PO.v1/?

    (I built a soap message to allow other apps can run a query (that was authorized and built by us) and pull data.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. In your template did you have something like ?PO={PO_ID}

      Delete
  2. Thanks Bob
    But I gave up on the Definition...

    I created Rest Post with a ? Parm
    and sent it to a generic Message NonRowset that I specified as a JSON format...

    And on the Routing , to an app package... With in that I just GETContentstring()
    Did the splitting an all the work .
    Created JSON Pasers and objects...

    And similar to pass back

    It was ssssooooo Much easier

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. hello, could you post full instruction for second example, i have follow your step but still not successful, because now Im doing create REST POST service with parameters in the message body instead of URL

    ReplyDelete
    Replies
    1. If you let me know your issue, I can try to help.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Can i know where you put the program for sending parameter in message body, using Application Engine or Application Package?

      Delete
    4. The code is in an application package. The parameters can be in the URL or in the body of the message. Usually it is in the url but I have an example of putting it in the body.

      Delete
    5. Hello Bob, it is appreciated that you can share the whole code for getting value in the message of body, your blog only the one doing on this inbound body message, if you can share to me, I will really appreciate it, Thank you

      Delete
    6. import PS_PT:Integration:IRequestHandler;
      class DCP_FS_PO_POST implements PS_PT:Integration:IRequestHandler
      method getPO_Vendor_Info();
      method OnRequest(&_MSG As Message) Returns Message;
      method OnError(&pRequestMsg As Message) Returns string;
      end-class;
      /* constructor */
      method getPO_Vendor_Info
      end-method;

      method OnRequest
      /+ &_MSG as Message +/
      /+ Returns Message +/
      /+ Extends/implements PS_PT:Integration:IRequestHandler.OnRequest +/
      Local Message &returnMsg;
      Local Document &returnDoc;
      Local Compound &returnCom, &returnCom2, &aComLn;
      Local Collection &returnColl;
      Local boolean &ret;
      Local DocumentKey &docKey;
      Local Primitive ≺
      Local string &sCriteria;

      /* Populate document with inbound message values from URI*/
      Local Document &PODoc = &_MSG.GetURIDocument();

      /* Get the PO id from the inbound document */
      Local string &PO_id = &PODoc.GetElement("PO_ID").value;

      Evaluate &_MSG.HTTPMethod
      When = %IntBroker_HTTP_POST

      Local Record &POVndrRec = CreateRecord(Record.DCP_PO_REST_VW);
      &POVndrRec.PO_ID.Value = &PO_id;
      &sCriteria = " WHERE PO_ID = '" | &POVndrRec.PO_ID.Value | "'";
      Local string &POVndrSQL_Str = "%SelectAll(:1)" | &sCriteria;

      Local SQL &SQL_PO_Vndr = CreateSQL(&POVndrSQL_Str, &POVndrRec);

      /*Construct response message */
      &returnMsg = CreateMessage(Operation.DCP_FS_PO_POST, %IntBroker_Response);
      &returnDoc = &returnMsg.GetDocument();
      &returnCom = &returnDoc.DocumentElement;

      /*Get 1st Row (for header ) */

      Local boolean &Found = &SQL_PO_Vndr.Fetch(&POVndrRec);

      &pr = &returnCom.GetPropertyByName("BUSINESS_UNIT");
      &pr.Value = &POVndrRec.BUSINESS_UNIT.Value;
      &pr = &returnCom.GetPropertyByName("PO_ID");
      &pr.Value = &POVndrRec.PO_ID.Value;
      While (&Found)
      /* Get the child compound element */
      &returnCom2 = &returnCom.GetPropertyByName("DCP_PO_LINES");
      /* Get the child collection element */
      &returnColl = &returnCom2.GetPropertyByName("PO_LINES_LIST");
      /*create a new compound (DCP_FS_PO_LN) and set the values of each primitive*/
      &aComLn = &returnColl.CreateItem();

      &pr = &aComLn.GetPropertyByName("QTY_OPEN");
      &pr.Value = &POVndrRec.QTY.Value;
      &pr = &aComLn.GetPropertyByName("INV_ITEM_ID");
      &pr.Value = &POVndrRec.INV_ITEM_ID.Value;
      &pr = &aComLn.GetPropertyByName("DESCR254_MIXED");
      &pr.Value = &POVndrRec.DESCR254_MIXED.Value;
      /* Concatenate multiple rows of the child entity and maintain the one to many relationship */
      &ret = &returnColl.AppendItem(&aComLn);
      &Found = &SQL_PO_Vndr.Fetch(&POVndrRec)
      End-While;

      When-Other
      /* throw error conditin */
      throw CreateException( - 1, - 1, "Invalid call %1", String(&_MSG.HTTPMethod));

      End-Evaluate;
      /* To see the JSON returned invoke from Handler Tester */
      Rem MessageBox(0, "", 0, 0, &returnDoc.GenJsonString());
      Return &returnMsg;

      end-method;

      method OnError
      /+ &pRequestMsg as Message +/
      /+ Returns String +/
      /+ Extends/implements PS_PT:Integration:IRequestHandler.OnError +/


      Local Message &returnMsg;
      Local Document &returnDoc;
      Local Compound &returnCom;
      Local Document &PODoc = &pRequestMsg.GetURIDocument();

      Local string &PO_id = &PODoc.GetElement("PO_ID").value;
      &returnMsg = CreateMessage(Operation.DCP_FS_PO_POST, %IntBroker_Fault);
      &returnDoc = &returnMsg.GetDocument();
      &returnCom = &returnDoc.DocumentElement;
      &returnCom.GetPropertyByName("PO_ID").value = &PO_id;
      &returnCom.GetPropertyByName("errorMsg").value = &pRequestMsg.IBException.ToString();
      rem Return &returnDoc.GenXmlString();
      Return &returnDoc.GenJsonString();
      end-method;

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Bob, I created a generic Rest message send.. That I build Json , Set Method , URL.. And off it goes ... I am not sure if you want me to share

      Delete
    2. You're welcome to share anything you might think would be helpful to others Thanks.

      Delete
  6. the Basic code to create JSON (Just need to Import your Methods)
    &RSPObj = CreateJsonObject();
    &RSPHeader = CreateJsonObject();
    /*Just A Q&D way of building Fields and valies in a JSON String*/
    &RSPHeader = &Rest.TblJSON("BUSINESS_UNIT,PO_ID,REQ_ID,PO_STATUS,REQ_STATUS", "p_custom_req_bu,p_custom_po_num,p_custom_req_num,p_custom_po_status,p_custom_requisition_status", &ONIT_Sync);
    rem &RSPHeader.AddProperty("p_custom_req_date", &Rec.GetField(&I).Value);
    &RSPHeader.AddProperty("p_custom_po_bu", &Xref_Rec.BUSINESS_UNIT.Value);
    &RSPHeader.AddProperty("p_custom_po_date", &PO_Rec.PO_DT.Value);
    &RSPHeader.AddProperty("p_custom_requisition_denied_reason", &Rest.escapeJSONString(&Comment));

    &RSPHeader.AddProperty("p_custom_app_status", &ONIT_Sync.PROCESS_STEP.Value);
    &RSPObj.AddJsonObject("atom", &RSPHeader);
    &Results = &Rest.GenericRestSend(&ResUrl, "PUT", &RSPObj);

    The GEneric Send :
    /* Send JSon Object */
    method GenericRestSend
    /+ &PosUrl as String, +/
    /+ &Method as String, +/
    /+ &ContentJsonObj as JsonObject +/
    /+ Returns String +/
    Local Message &Request, &response;
    Local IBInfo &info;
    Local string &MainURL;
    Local string &ContentString;
    Local boolean &Okay;
    Local string &ReturnContent, &Authorization;

    &MainURL = &ServerURL | &PosUrl;

    &Request = CreateMessage(Message.IB_GENERIC);
    &info = &Request.IBInfo;

    &info.IBConnectorInfo.ConnectorName = "HTTPTARGET";
    &info.IBConnectorInfo.ConnectorClassName = "HttpTargetConnector";

    &Okay = &info.IBConnectorInfo.DeleteConnectorProperties("URL");
    &Okay = &info.IBConnectorInfo.DeleteConnectorProperties("Method");
    rem &Okay = &info.IBConnectorInfo.DeleteConnectorProperties("Authorization");

    &Okay = &info.IBConnectorInfo.AddConnectorProperties("accept", "application/json", %Header);
    &Okay = &info.IBConnectorInfo.AddConnectorProperties("Content-Type", "application/json", %Header);

    If &N_TOKEN_ID > " " Then
    &Okay = &info.IBConnectorInfo.AddConnectorProperties("authorization", &N_TOKEN_ID, %Header);
    End-If;
    &Okay = &info.IBConnectorInfo.AddConnectorProperties("URL", &MainURL, %HttpProperty);
    &Okay = &info.IBConnectorInfo.AddConnectorProperties("Method", &Method, %HttpProperty);

    If All(&ContentJsonObj) Then

    /*Remove Pretty */
    If &JsonCompress Then
    Local JsonGenerator &JGen = CreateJsonGenerator();
    Local JsonNode &JNode = CreateJsonNode();
    &JNode.SetJsonObject(&ContentJsonObj);
    &JGen.SetRootNode(&JNode);
    &JGen.SetPrettyMode( False);
    &ContentString = &JGen.ToString();
    Else /*LEave*/
    &ContentString = &ContentJsonObj.ToString();
    End-If;
    &Okay = &Request.SetContentString(&ContentString);
    End-If;

    &response = %IntBroker.ConnectorRequest(&Request, True);


    rem MessageBox(0, "", 0, 0, &response.GetContentString());
    If &response.ResponseStatus <> %IB_Status_Success Then
    Return ("*999 Connecton Issue:" | &MainURL | " Error:" | &response.IBException.ToString());
    End-If;

    &ReturnContent = &response.GetContentString();

    /* Check To make sure something is there */
    If None(&ReturnContent) Then
    Return "*997 Nothing Returned! URL:" | &MainURL;
    End-If;

    Return &ReturnContent;

    end-method;

    ReplyDelete
    Replies
    1. Thanks for posting. I'm sure others will find this useful.

      Delete
  7. A couple other useful methods

    method escapeJSONString
    /+ &instring as String +/
    /+ Returns String +/
    Local string &out;
    &out = &instring;
    /* "/" substitution must be first */
    &out = Substitute(&out, Char(92), ("\" | Char(92) | Char(92)));
    &out = Substitute(&out, Char(8), "\b");
    &out = Substitute(&out, Char(9), "\t");
    &out = Substitute(&out, Char(10), "\n");
    &out = Substitute(&out, Char(12), "\f");
    &out = Substitute(&out, Char(13), "\r");
    &out = Substitute(&out, Char(34), "\" | Char(34));
    Return &out;
    end-method;

    /* Build Json Object based of record */
    method TblJSON
    /+ &FieldList as String, +/
    /+ &NewLabel as String, +/
    /+ &Rec as Record +/
    /+ Returns JsonObject +/;

    Local integer &I;
    Local array of string &FieldListArray = CreateArrayRept("", 0);
    Local array of string &NewProperty = CreateArrayRept("", 0);
    Local string &PropertyName;
    Local JsonObject &JSonObj = CreateJsonObject();

    If All(&FieldList) Then /* If Propety name is differnt from Table Field Name*/
    &FieldListArray = Split(&FieldList, ",");
    End-If;
    If All(&NewLabel) Then /* If Propety name is differnt from Table Field Name*/
    &NewProperty = Split(&NewLabel, ",");
    End-If;

    For &I = 1 To &Rec.FieldCount
    If None(&FieldList) Or
    (All(&FieldList) And
    %This.Checkarray(&Rec.GetField(&I).Name, &FieldList)) Then
    &PropertyName = &Rec.GetField(&I).Name;

    If All(&NewLabel) Then
    &PropertyName = &NewProperty [&FieldListArray.Find(&PropertyName)];
    End-If;
    &JSonObj.AddProperty(&PropertyName, &Rec.GetField(&I).Value);
    End-If;
    End-For;

    Return &JSonObj;

    end-method;

    ReplyDelete
    Replies
    1. Thanks for posting. I like the method for escaping the JSON. Having a way to create JSON from a table could be very useful.

      Delete

Post a Comment