Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Get relatedUpdates from DSresponse in DSCallback

    Hi Isomorphic,

    is there any way to get "relatedUpdates values" from DSResponse (using latest 12.0p built)?

    Code:
    DataSource.get("DatasourceName").performCustomOperation("operationId", record,
                                    new DSCallback() {
                                        @Override
                                        public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
    
                                            //get relatedUpdates values from DSResponse
    
                                        }
                                    });
    Best regards
    Pavo

    #2
    You currently would need to use the APIs inherited from the DataClass superclass to retrieve the relatedUpdates attribute and work with them as JavaScript Objects. We plan to add an accessor API to make this simpler and more obvious.

    Comment


      #3
      Hi Isomorphic,

      thank you very much.

      I'm getting values from relatedUpdates this way:
      Code:
      Map<String, Object> valueMap = Helper.getRelatedUpdateFromJSObject((JavaScriptObject) dsResponse.getAttributeAsObject("relatedUpdates"));
      ...
      ...
          public static HashMap<String, Object> getRelatedUpdateFromJSObject(JavaScriptObject jso) {
              @SuppressWarnings("unchecked")
              ArrayList<Map<String, ArrayList<Map<String, Object>>>> al = (ArrayList<Map<String, ArrayList<Map<String, Object>>>>) JSOHelper
                      .convertToJava(jso);
              return (HashMap<String, Object>) al.get(0).get("data").get(0);
          }
      Would be great that you add an accessor API to make this simpler, but it's also fine for me if it will always work this way.

      Best regards
      Pavo

      Comment

      Working...
      X