Forum Discussion
angela
5 years agoCatalyst II
Hi Miraks,
newResult can just return text. Maybe you can add your output to a temporary Aras item and then return the item?
- miraks5 years agoCreator II
Hi Angelalp,
Thank you for your answer.
If my method is like this:
return this.getInnovator().newResult(new Newtonsoft.Json.Linq.JObject
{
{"return_code", 0} ,
{"message", "hello world!"}
}.ToString(Newtonsoft.Json.Formatting.None));The output is a text:
If my method is like this:
var item = this.getInnovator().newItem();
item.setProperty("json", new Newtonsoft.Json.Linq.JObject
{
{"return_code", 0} ,
{"message", "hello world!"}
}.ToString(Newtonsoft.Json.Formatting.None));
return item;The output is a text:
So, you are right, with your solution the output is well a JSON.
But a JSON of an Item. Is it possible to send a fully customized JSON ?
Regards.
- angela5 years agoCatalyst II
Hi Miraks,
standard Aras Method just can return items. "Results" and "Error" are also just items.
Maybe you can use some kind of custom class or other more native C# techniques, but I am not sure. Some times you see these kind of designs in native Aras code.