Serialize Json with data from a table in D365FO
Views (1156)
Hi,
In this post, we will see how to serialize the data to Json from a table in D365FO. If we have all the required data in a single table then this approach can be used.
class CG_SerializeJsonFromTable{ /// <summary> /// Runs the class with the specified arguments. /// </summary> /// <param name = "_args">The specified arguments.</param> public static void main(Args _args) { CustTable custTable; JsonSerializerSettings settings = null; str json; select firstonly custTable where custTable.AccountNum == "1000"; JsonTableSerializer jsonTable = new JsonTableSerializer(settings); json = jsonTable.serialize(custTable); Info(strFmt("%1", json)); } }Output: https://drive.google.com/open?id=1pptktN6Js7BEpoPOePzLKF7bq9v5XuAN
Regards,
Chaitanya Golla

Like
Report
*This post is locked for comments