Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function beforeDelete(row, errors){
query = queries[j];
for (var i=0;i<fields.length;i++){
fieldName = fields[i];
if (helper.verifyNotUsed('ehr_compliancedb', query, 'requirementname', row[fieldName])){
if (helper.verifyNotUsed('ehr_compliancedb', query, 'requirementname', row[fieldName], 'requirements')){
addError(errors, fieldName, 'Cannot delete row with value: ' + row[fieldName] + ' because it is referenced by the table ' + query);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ var helper = org.labkey.ldk.query.LookupValidationHelper.create(LABKEY.Security.
var ehrHelper = org.labkey.ehr.utils.TriggerScriptHelper.create(LABKEY.Security.currentUser.id, LABKEY.Security.currentContainer.id);

function beforeDelete(row, errors){
if (helper.verifyNotUsed('onprc_billing', 'invoicedItems', 'chargeid', row['rowid'])){
if (helper.verifyNotUsed('onprc_billing', 'invoicedItems', 'chargeid', row['rowid'], 'chargeableItems')){
addError(errors, 'name', 'Cannot delete row with ID: ' + row['rowid'] + ' because it is referenced by the table invoicedItems. You should inactivate this item instead.');
}

if (helper.verifyNotUsed('onprc_billing', 'miscCharges', 'chargeid', row['rowid'], ehrHelper.getEHRStudyContainerPath())){
if (helper.verifyNotUsed('onprc_billing', 'miscCharges', 'chargeid', row['rowid'], ehrHelper.getEHRStudyContainerPath(), 'chargeableItems')){
addError(errors, 'name', 'Cannot delete row with ID: ' + row['rowid'] + ' because it is referenced by the table miscCharges. You should inactivate this item instead.');
}
}
Expand Down