{
  "Branch_Delete": {
    "layout":"form",
    "title":"Delete Revision",
    "menu":"Revisions",
    "onecolumn":true,
    "roles": {"AUTHOR": "BU","PUBLISHER": "BU"},
    "sqlselect":[
      "select ",
      "(select branch_desc from {schema}.v_my_branch_desc where branch_id=@branch_id and branch_access='RW') branch_name"
    ],
    "sqlupdate":[
      "begin transaction;",
      "update {schema}.branch set branch_parent_id = null where branch_parent_id = @branch_id;",
      "delete from {schema}.branch where branch_id = (select branch_id from {schema}.v_my_branch_access where branch_id=@branch_id and branch_access='RW');",
      "commit transaction;",
    ],
    "hide_system_buttons":["print","save"],
    "fields": [
      {"name":"branch_id","type":"bigint","control":"hidden","key":true},
      {"name":"branch_name","control":"label","caption":"Deleting Revision","captionstyle":"text-align:right;font-weight:bold;"},
      {"control":"html","value":"<br/>"},
      {"control":"html","caption":"&#x26A0; Warning","value":"This action cannot be undone.  Are you sure you want to delete this revision?<br/>","nl":true,"captionstyle":"color:red;font-weight:bold;text-align:right;"},
      {"control":"button","value":"Yes","controlstyle": "padding:3px 8px;margin-top:6px;","onclick": "XForm.prototype.XExecutePost(xmodel.id+'/?branch_id='+xmodel.get('branch_id'), { }, function(rslt){ XExt.navTo(jsh._BASEURL+xmodel.module_namespace+'Branch_Active_Listing'); });"},
      {"control":"button","value":"No","controlstyle": "padding:3px 8px;margin-top:6px;","onclick": "XExt.navTo(jsh._BASEURL+xmodel.module_namespace+'Branch_Active_Listing');","nl":false}
    ]
  }
}
