I need to export Sales Orders into a JSON file but I am struggling to write the code (I am new to JSON). I attached a simple FMP file with 3 Sales Orders Head, Sales Order Lines and 3 Customers. The JSON output I need (based on the FMP file attached) is the following. Can anybody help me to write the script to do that?
Thank you.
Michele Annoni
{
"ORDER": [
{
"Order_Nr": "0001",
"Date": "01/10/2023",
"Total": "100.23",
"CUSTOMER": {
"CustomerID": "1",
"Name": "CUSTOMER_1"
},
"ITEMS": [
{
"Product_ID": "AA000K",
"Product_Desc": "GEAR"
},
{
"Product_ID": "BB333D",
"Product_Desc": "ENGINE"
},
{
"Product_ID": "CC444H",
"Product_desc": "PISTON"
}
]
},
{
"Order_Nr": "0002",
"Date": "01/11/2023",
"Total": "25.12",
"CUSTOMER": {
"CustomerID": "2",
"Name": "CUSTOMER_2"
},
"ITEMS": [
{
"Product_ID": "FFTG66",
"Product_Desc": "WHEEL"
},
{
" Product_ID ": "DD35TSH",
" Product_Desc ": "REAR WINDOW"
}
]
}
]
}
JSON File.fmp12