{
  "name": "dialog/document/query_init.json",
  "info": "code uses this: dialog/document/documet_type_permission.json",
  "rec": "dialog/document/rec.json",
  "data_query_future": [
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_so.data", "so_record_id", "so_"]]]]},
    {"tag": "work_order_so_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_so.data", "co_record_id", "co_"]]]]},
    {"tag": "work_order_so_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"run": [["parameter.link1", "=", ["concat", ["'sor_", "parameter.sales_order_row", "'"]]]]},
    {"tag": "reclamation_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"tag": "reclamation_so", "query": "query/af/document/document_query_reclamation_so.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.reclamation_so.data", "rcl_record_id", "rcl_"]]]]},
    {"tag": "reclamation_so", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"tag": "work_order_so", "query": "query/af/document/document_query_work_order_so.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_so.data", "wo_record_id", "wo_"]]]]},
    {"tag": "work_order_so", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_so.data", "w_record_id", "w_"]]]]},
    {"tag": "work_so", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_qry.data", "w_record_id", "w_"]]]]},
    {"tag": "work_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"}

  ],
  "data_query": [
    {"tag": "sales_order_row_qry", "query": "query/af/document/document_query_sales_order_row.json"},
    {"run": [["parameter.product2", "=", ["reduce", ["arrayFirstKey", "data.sales_order_row_qry.data", "pr_product_id", ""]]]]},
    {"run": [["if", ["parameter.product2", "<>", ""], [["parameter.product", "=", "parameter.product2"]]]]},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_row_qry.data", "sor_record_id", "sor_"]]]]},
    {"tag": "sales_order_row", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_row_qry.data", "so_record_id", "so_"]]]]},
    {"tag": "sales_order", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_row_qry.data", "co_record_id", "co_"]]]]},
    {"tag": "company_so", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"tag": "sales_order_qry", "query": "query/af/document/document_query_sales_order.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_qry.data", "so_record_id", "so_"]]]]},
    {"tag": "sales_order2", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_qry.data", "co_record_id", "co_"]]]]},
    {"tag": "company_so2", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"tag": "product_name_qry", "query": "query/pr/product_id.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.product_name_qry.data", "co_record_id", "co_"]]]]},
    {"tag": "company_pr", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.product_name_qry.data", "w_record_id", "w_"]]]]},
    {"tag": "work_pr", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"tag": "work_order_qry", "query": "query/af/document/document_query_work_order.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_qry.data", "wo_record_id", "wo_"]]]]},
    {"tag": "work_order", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_qry.data", "so_record_id", "so_"]]]]},
    {"tag": "sales_order_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.work_order_qry.data", "co_record_id", "co_"]]]]},
    {"tag": "company_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"tag": "reclamation_wo_qry", "query": "query/af/document/document_query_reclamation_wo.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.reclamation_wo_qry.data", "rcl_record_id", "rcl_"]]]]},
    {"tag": "reclamation_wo", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},

    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.product_name_qry.data", "pr_record_id", "pr_"]]]]}
  ],
  "grid": [
    {
      "name": "document",
      "query": "query/af/document/document_query_link1.json",
      "columns": "output/af/document/document_column.json"
    }
  ]
}
