Sending back the jsdo - Forum - Mobile - Progress Community

Sending back the jsdo

 Forum

Sending back the jsdo

This question is not answered

Hi There, 

I am building up the jsdo and then saving the changes back to the database. When this method is called an appserver hit is performed for each row in the kendo grid. How would I be able to send back the jsdo once. I am trying to generate an order and this issue is causing multiple orders to be created instead of one order.

I am using jsdo.add and then when I am finished adding my records, I call jsdo.saveChanges().

TIA

All Replies
  • This may be a stupid question but is there no way that I can create my own method and call it on the client?

    If not, would there not be a way to invoke the update method to do what I need it to do? if so, is there an example for me to look at?

    Is there any means possible to for me to do what im wanting to do without upgrading to 11.5?

  • Yes that is possible. As long as the method is available in your catalog you can invoke it.

    See community.progress.com/.../22773

  • The best would be to use Submit because it uses the JSON before-image format and you can send different types of operations: creates, updates, and deletes.

    The approach that Ruben mentioned would be to call an invoke the method as an invoke operation.

    Another approach would be to try to use the method that you defined as a Submit.

    There is a recent option in the JSDO where you can use saveChanges(true) with a backend that does not have the JSON before-image format.

    documentation.progress.com/.../

    You would need to write the code for method.

    For this you would need to manually change get to put in the catalog.

    Please give this a try to see if it works with your 11.3. Still, you might want to try upgrading to a more recent version.

    (Take a look at the new WebHandlers support in WebSpeed if you upgrade to 11.6.)

  • I have tried editing the jsdo file and changing the parameters of the submit operation. When I ran it, I could see the request was built up but a 404 error was returned. So now I have tried creating an invoke method. When I run this method on the application, the appserver returns an error and I can see that my invoke is trying to access the Update Method.

    Would there need to be something special set up in the business entity?

       @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="true").

       @progress.service.resourceMapping(type="REST", operation="invoke", URI="", alias="", mediaType="application/json").

       METHOD PUBLIC VOID LoadbeOrdLn(INPUT-OUTPUT DATASET dsrntprod):                    

           MESSAGE "Invoke Method".

       END METHOD.    

  • I'm accessing the method from the client by doing this:

    var jsdo = new progress.data.JSDO('beOrdLn');

    jsdo.invoke("LoadbeOrdLn",{});

  • The invoke approach should work fine. Support for invoke is available since 11.2.

    The approach with making the invoke operation work as a Submit could work... but you would be trying to do something that was not available with the 11.3 release.

    It would be better to just focus on doing invoke operations.

    You would need to update the catalog file to say invoke.

    The following thread related to invoke operations might be useful to you:

       community.progress.com/.../24084