{
  "info": "---- ?? tarkoittaa epäselvää",
  "name": "drawingmissing",
  "query": [
    ["_set_CREATE", ["w_tbl", "w_MissingDrawingSetOrig"]],

    [
      "if", ["true"],
      [
        ["pr_DOCUMENT_EXIST", ["Piirrustus", "w_tbl"]],
        ["_set_CREATE", ["w_tbl", "w_MissingDrawingSet1"]]
      ],
      "else",
      [
        ["_txt", "=", "Piirustus"],
        ["_qry_Fld", ["0", ["af_header", "=", "_txt"], "", "false"]],
        ["_Ink_SELECTION_LINKED_SELECT", ["0", "af_tbl", "w_tbl"]],
        ["_set_CREATE", ["w_tbl", "w_MissingDrawingSet1"]],
        ["_Ink_SELECTION_LINKED_SELECT", ["0", "af_tbl", "pr_tbl"]],
        ["_sel_RELATE_MANY_SELECTION", ["w_product_id"]],
        ["_set_CREATE", ["w_tbl", "w_MissingDrawingSet2"]],
        ["_set_UNION", ["w_tbl", "w_MissingDrawingSet1", "w_MissingDrawingSet2", "w_MissingDrawingSet1"]],
        ["_set_CLEAR", ["w_tbl", "w_MissingDrawingSet2"]]
      ]
    ],
    ["_set_DIFFERENCE", ["w_tbl", "w_MissingDrawingSetOrig", "w_MissingDrawingSet1", "w_MissingDrawingSet1"]],
    ["_set_USE", ["w_tbl", "w_MissingDrawingSet1"]],
    ["_set_CLEAR", ["w_tbl", "w_MissingDrawingSet1"]],
    ["_set_CLEAR", ["w_tbl", "w_MissingDrawingSetOrig"]]
  ]
}
