diff --git a/entity/RoleChildren_entity/recordcontainers/jdito/contentProcess.js b/entity/RoleChildren_entity/recordcontainers/jdito/contentProcess.js index 63c4b642005da413c5dc0934bbc91698b523fcb2..f60d6a7070cacdb246b26fee65f6388efd38a840 100644 --- a/entity/RoleChildren_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/RoleChildren_entity/recordcontainers/jdito/contentProcess.js @@ -6,13 +6,11 @@ import("system.util"); var alias = SqlUtils.getSystemAlias(); var parentRoleName = vars.exists("$param.RoleId_param") && vars.get("$param.RoleId_param"); +var children = []; -if (parentRoleName) { - if (parentRoleName.indexOf("CUSTOM_") == -1) { - parentRoleName = "CUSTOM_" + parentRoleName; - } - var children = []; - var sqlStr = "select CHILD_ROLE, UID from ASYS_ROLES_CHILDREN where PARENT_ROLE = '" + parentRoleName + "'"; +if (parentRoleName && parentRoleName.indexOf("CUSTOM_") != -1) { + // parentRoleName is a viable CUSTOM role + var sqlStr = "select CHILD_ROLE, ID from ASYS_ROLES_CHILDREN where PARENT_ROLE = '" + parentRoleName + "'"; var childRoles = db.table(sqlStr, alias); if (childRoles.length != 0) { for each (let childRole in childRoles) { diff --git a/entity/RoleChildren_entity/recordcontainers/jdito/onDelete.js b/entity/RoleChildren_entity/recordcontainers/jdito/onDelete.js index 365ce90d2b18b85ea4295f381cd91e630804f4ef..778e62eb9820cecef3e378e97114d53f78cea22f 100644 --- a/entity/RoleChildren_entity/recordcontainers/jdito/onDelete.js +++ b/entity/RoleChildren_entity/recordcontainers/jdito/onDelete.js @@ -4,4 +4,4 @@ import("system.vars"); var uid = vars.get("$field.UID"); var alias = SqlUtils.getSystemAlias(); -db.deleteData("ASYS_ROLES_CHILDREN", "UID = '" + uid + "'", alias) \ No newline at end of file +db.deleteData("ASYS_ROLES_CHILDREN", "ID = '" + uid + "'", alias) \ No newline at end of file diff --git a/entity/RoleChildren_entity/recordcontainers/jdito/onInsert.js b/entity/RoleChildren_entity/recordcontainers/jdito/onInsert.js index f3c80db62f6d591f7d13df726f8030ae7bc28260..bca1f461dfcba8df142c4aac68c7c2da8a03cb19 100644 --- a/entity/RoleChildren_entity/recordcontainers/jdito/onInsert.js +++ b/entity/RoleChildren_entity/recordcontainers/jdito/onInsert.js @@ -14,5 +14,5 @@ if (parentRoleName) { var childRole = vars.get("$local.rowdata")["CHILD_ROLE.value"]; var uid = util.getNewUUID(); - db.insertData("ASYS_ROLES_CHILDREN", ["CHILD_ROLE", "PARENT_ROLE", "UID"], null, [childRole, parentRoleName, uid], alias); + db.insertData("ASYS_ROLES_CHILDREN", ["CHILD_ROLE", "PARENT_ROLE", "ID"], null, [childRole, parentRoleName, uid], alias); } \ No newline at end of file diff --git a/entity/RoleChildren_entity/recordcontainers/jdito/onUpdate.js b/entity/RoleChildren_entity/recordcontainers/jdito/onUpdate.js index 57ea567f75be74d7170e636a1fc471b848affd53..80a5dfd715543880ae6c53ac1dd739a2b92c3edb 100644 --- a/entity/RoleChildren_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/RoleChildren_entity/recordcontainers/jdito/onUpdate.js @@ -14,5 +14,5 @@ if (parentRoleName) { var childRole = vars.get("$local.rowdata")["CHILD_ROLE.value"]; var uid = vars.get("$field.UID"); - db.updateData("ASYS_ROLES_CHILDREN", ["CHILD_ROLE"], null, [childRole], "UID = '" + uid + "'", alias); + db.updateData("ASYS_ROLES_CHILDREN", ["CHILD_ROLE"], null, [childRole], "ID = '" + uid + "'", alias); } \ No newline at end of file