Hi Martin,
Thanks for the suggestion.
I followed the below link and try to achieve it on Ax 2012 R3 only and it helped but the only confusion is, i am not able to achieve the multiple JSON string which i have described below.
community.dynamics.com/.../1025796
I have checked that out, and for json like following:
{
"success": true,
"data": [
{
"CUST_GROUP_ID": 1,
"CUST_GROUP_NAME": "Customer Group 1",
"INSERT_FLAG": "Y",
"RECORD_SENT_FLAG": "N",
"ERROR_MESSAGE": null,
"LAST_UPDATE_DATE": "2020-03-01T13:29:29.000Z",
"LAST_UPDATED_BY": 0,
"CREATION_DATE": "2020-03-01T13:29:29.000Z",
"CREATED_BY": 0
},
{
"CUST_GROUP_ID": 2,
"CUST_GROUP_NAME": "Customer Group 2",
"INSERT_FLAG": "Y",
"RECORD_SENT_FLAG": "N",
"ERROR_MESSAGE": null,
"LAST_UPDATE_DATE": "2020-03-01T13:29:29.000Z",
"LAST_UPDATED_BY": 0,
"CREATION_DATE": "2020-03-01T13:29:29.000Z",
"CREATED_BY": 0
}
]
}
I am trying to create a job with below code
.
RetailWebRequest request;
RetailWebResponse response;
str rawResponse;
RetailCommonWebAPI webApi;
System.IO.Stream requestStream, responseStream;
System.IO.StreamReader reader;
Object deserializedContract;
List list;
ListIterator listIterator;
CreateCustGroupContract custGroupContract;
CustGroupList custGroupList;
webApi = RetailCommonWebAPI::construct();
request = RetailWebRequest::newUrl("URL");
response = webApi.getResponse(request);
rawResponse = response.parmData();
custGroupList = new CustGroupList();
listIterator = new ListIterator(custGroupList.parmDataDetail());
while (listIterator.more())
{
custGroupContract = SMCFormJsonSerializer::deserializeObject(classIdGet(custGroupContract), listIterator.value());
info(strFmt('%1', custGroupContract.parmCustGroupId()));
info(custGroupContract.parmCustGroupName());
listIterator.next();
}
but its only return "CUST_GROUP_ID": 1, "CUST_GROUP_NAME": "Customer Group 1".
How can we achieve all the json string like "CUST_GROUP_ID": 1, "CUST_GROUP_NAME": "Customer Group 1", "CUST_GROUP_ID": 2, "CUST_GROUP_NAME": "Customer Group 2".
Can you please help me to achieve the requirement.
Thanks,
Somesh