v12.1p_2020-12-19/LGPL Development Only
I using RestDatasource to fetch data from server, while using transformRequest() method , i added some property into dsRequest , it seems that additional property are not serialized and send to server. this is my RestDataSource configuration.
the default json object dsRequest send to server
i would like add more properties into json object for dsRequest which something like this ( added "masterRequest" and "authorityKey" property
I using RestDatasource to fetch data from server, while using transformRequest() method , i added some property into dsRequest , it seems that additional property are not serialized and send to server. this is my RestDataSource configuration.
Code:
isc.RestDataSource.create({ ID: "countryDS", dataFormat: "json", fields: [ { name: "countryCode", title: "Code" }, { name: "countryName", title: "Country" }, { name: "capital", title: "Capital" } ], cacheAllData: false, operationBindings: [{ operationType: "fetch", dataProtocol: "postMessage", dataURL: "./Handler1.ashx", requestProperties: { httpHeaders: { DataName: "OrderTypeLookup", DataType: "View" }, } }], transformRequest: function (dsRequest) { dsRequest.masterRequest = true; dsRequest.authorityKey = "idojdsfj823479jr9234srh"; dsRequest.data = JSON.stringify({ abc: 1234 }); this.Super("transformRequest", arguments); }, })
Code:
{ "dataSource": "countryDS", "operationType": "fetch", "textMatchStyle": "exact", "componentId": "abcde", "data": "{"abc":"1234"}", "oldValues": null }
Code:
{ "dataSource": "countryDS", "operationType": "fetch", "textMatchStyle": "exact", "componentId": "abcde", "masterRequest:"true", "authorityKey": "idojdsfj823479jr9234srh", "data": "{"abc":"1234"}", "oldValues": null }
Comment