I can't delete status via api when I deleted all record?

I deleted all record in a app, after I update status setting via API but I get message “Cannot delete the status. A record with the status that you are attempting to delete exists in the app in preview.

This is body, I called:

{
  "app": "83",
  "states": {
    "完了": {
      "name": "完了",
      "index": "10",
      "assignee": {
        "type": "ONE",
        "entities": []
      }
    },
    "立案依頼中": {
      "name": "立案依頼中",
      "index": "1",
      "assignee": {
        "type": "ONE",
        "entities": [
          {
            "entity": {
              "type": "FIELD_ENTITY",
              "code": "立案実行者"
            },
            "includeSubs": false
          }
        ]
      }
    },
    "押印作業中": {
      "name": "押印作業中",
      "index": "7",
      "assignee": {
        "type": "ONE",
        "entities": []
      }
    },
    "稟議書削除依頼": {
      "name": "稟議書削除依頼",
      "index": "2",
      "assignee": {
        "type": "ONE",
        "entities": []
      }
    },
    "無効": {
      "name": "無効",
      "index": "8",
      "assignee": {
        "type": "ONE",
        "entities": []
      }
    },
    "欠番": {
      "name": "欠番",
      "index": "3",
      "assignee": {
        "type": "ONE",
        "entities": []
      }
    },
    "決裁申請中": {
      "name": "決裁申請中",
      "index": "5",
      "assignee": {
        "type": "ONE",
        "entities": [
          {
            "entity": {
              "type": "FIELD_ENTITY",
              "code": "決裁承認実行者"
            },
            "includeSubs": false
          }
        ]
      }
    },
    "稟議書未作成": {
      "name": "稟議書未作成",
      "index": "0",
      "assignee": {
        "type": "ONE",
        "entities": [
          {
            "entity": {
              "type": "FIELD_ENTITY",
              "code": "作成者"
            },
            "includeSubs": false
          }
        ]
      }
    },
    "承認済み": {
      "name": "承認済み",
      "index": "6",
      "assignee": {
        "type": "ONE",
        "entities": [
          {
            "entity": {
              "type": "FIELD_ENTITY",
              "code": "立案実行者"
            },
            "includeSubs": false
          }
        ]
      }
    },
    "一次承認申請中": {
      "name": "一次承認申請中",
      "index": "4",
      "assignee": {
        "type": "ANY",
        "entities": [
          {
            "entity": {
              "type": "FIELD_ENTITY",
              "code": "一次承認実行者"
            },
            "includeSubs": false
          }
        ]
      }
    },
    "書類保管確認依頼中": {
      "name": "書類保管確認依頼中",
      "index": "9",
      "assignee": {
        "type": "ANY",
        "entities": []
      }
    }
  },
  "actions": [
    {
      "name": "立案依頼をする",
      "from": "稟議書未作成",
      "to": "立案依頼中",
      "filterCond": ""
    },
    {
      "name": "稟議書削除依頼",
      "from": "稟議書未作成",
      "to": "稟議書削除依頼",
      "filterCond": ""
    },
    {
      "name": "立案する",
      "from": "立案依頼中",
      "to": "一次承認申請中",
      "filterCond": ""
    },
    {
      "name": "差戻",
      "from": "立案依頼中",
      "to": "稟議書未作成",
      "filterCond": ""
    },
    {
      "name": "欠番",
      "from": "稟議書削除依頼",
      "to": "欠番",
      "filterCond": ""
    },
    {
      "name": "一次承認をする",
      "from": "一次承認申請中",
      "to": "決裁申請中",
      "filterCond": ""
    },
    {
      "name": "差戻",
      "from": "一次承認申請中",
      "to": "稟議書未作成",
      "filterCond": ""
    },
    {
      "name": "決裁承認をする",
      "from": "決裁申請中",
      "to": "押印作業中",
      "filterCond": "印章 in ("実印", "角印(原本)", "角印", "銀行印")"
    },
    {
      "name": "差戻",
      "from": "決裁申請中",
      "to": "稟議書未作成",
      "filterCond": "印章 in ("実印", "角印(原本)", "角印", "銀行印")"
    },
    {
      "name": "決裁承認をする",
      "from": "決裁申請中",
      "to": "承認済み",
      "filterCond": "印章 in ("なし")"
    },
    {
      "name": "差戻",
      "from": "決裁申請中",
      "to": "稟議書未作成",
      "filterCond": "印章 in ("なし")"
    },
    {
      "name": "書類の保管確認を依頼する",
      "from": "承認済み",
      "to": "書類保管確認依頼中",
      "filterCond": "印章 in ("実印", "角印(原本)", "角印", "銀行印")"
    },
    {
      "name": "再捺印依頼",
      "from": "承認済み",
      "to": "押印作業中",
      "filterCond": "印章 in ("実印", "角印(原本)", "角印", "銀行印")"
    },
    {
      "name": "無効",
      "from": "承認済み",
      "to": "無効",
      "filterCond": "印章 in ("実印", "角印(原本)", "角印", "銀行印")"
    },
    {
      "name": "書類の保管確認を依頼する",
      "from": "承認済み",
      "to": "書類保管確認依頼中",
      "filterCond": "印章 in ("なし")"
    },
    {
      "name": "押印作業完了",
      "from": "押印作業中",
      "to": "承認済み",
      "filterCond": ""
    },
    {
      "name": "無効",
      "from": "押印作業中",
      "to": "無効",
      "filterCond": ""
    },
    {
      "name": "書類保管確認完了",
      "from": "書類保管確認依頼中",
      "to": "完了",
      "filterCond": ""
    },
    {
      "name": "無効",
      "from": "書類保管確認依頼中",
      "to": "無効",
      "filterCond": ""
    },
    {
      "name": "無効",
      "from": "完了",
      "to": "無効",
      "filterCond": ""
    }
  ],
  "enable": true,
  "__REQUEST_TOKEN__": "4e203890-5356-4e39-aaaa-33b20b8d0d05"
}

Can you help me? which problem is this?

Thanks!

Hello Tan,

You will receive the error message when you attempt to delete the status, and the record with the target status already exists.
You must change the status of the record to delete it.

2 Likes

Hello Chris,

I deleted all records in app, but i can’t delete status.

Thanks for your support

Hello Tan,

Do you get the same error when you attempt to delete the status manually?

Edit 6/14:
You can check whether there is any record in an app by checking the App Management regardless of the permission settings.

kintone - Checking Apps on the “App Management” Screen

Also, FYI, if you have any records in the test environment of an app, the error will occur too.

kintone - Performing Functional Tests on Apps

Best,
Chris

Hello Chris,

I found records in test environment

Thank you so much