E
egarcia
Guest
Hello, You only need to send one parameter to the invoke operation when using the name of the method. This single object parameter contains properties for each of the parameters that you are sending to the server. It would look like the following: jsdo.GetWarnings({ "dsWarning": , "plcParameter": }) The value for dsWarning is a DataSet so the value itself would have the name of the dataset and the name of the temp-table and the data as an array. You would see this in the Network tab. (See debugging tip below.) The method _createChangeSet() is consider to be internal and is not part of the public API. However, I can see that it does what you need which I am assuming is to get the values changed so that you can validate prior to performing saveChanges(). Is plcParameter another DataSet or a Temp-Table? If it is a DataSet, it should have a similar structure to oParameterDS, i.e., it would have the name of the dataset and the name of the temp-table. If it is a Temp-Table, then it would only have the name of the temp-table and the data as an array. Once you fix oParameter, you should be able to change the call to GetWarnings to the following: jsdo.GetWarnings({ "dsWarning": oParameterDS, "plcParameter": oParameter }); Debugging Tip You can take a look at the request payload in the Network tab to confirm that the parameters are being sent. You should see something like the following: { "request": { "dsWarning": { "dsWarning": { "eEntity": [{ "EntityType": "Test1", "EntityRef": "Test1" }] } }, "plcParameter": { "plcParameter": [{ "EntityType": "Test1", "EntityRef": "Test1" }] } } } Please notice that the request object that is sent to the server would have "dsWarning" twice, once as the name of the parameter and a second time as part of the structure of the DataSet. For the example above, I am using "plcParameter" as if it was a TEMP-TABLE. You can call invoke operations using the name of the method (as you have in your example): jsdo.GetWarnings(parameters); or using the invoke() method in the JSDO: jsdo.invoke("GetWarnings", parameters); The invoke operation is asynchronous by default. (When calling by name you can pass an additional parameter to make the call synchronous but this approach is not recommended since it would block the UI until the request completes.) To handle the response you would either need to subscribe to the AfterInvoke event or use a Promise. The documentation and the examples below show how to use both approaches: documentation.progress.com/.../ oemobiledemo.progress.com/.../example004.html oemobiledemo.progress.com/.../example015.html oemobiledemo.progress.com/.../example016.html Please let me know if you need more information. I hope this helps.
Continue reading...
Continue reading...