uses core.data as data; uses core.complex as complex; uses core.log as log; references model docPerson; export procedure executeScriptparameters() begin // Create constants to hold the dataspace, dataset, and table const dataspace := data.findDataspace(_ebx.parameters.dataspace); const dataset := data.findDataset(dataspace, _ebx.parameters.dataset); const table := data.findTable(dataset); // Initiate transaction execute transaction tr on dataspace begin // Get current record using XPath var currRecord := data.lookupRecordByFullXPathForUpdate(tr, table, _ebx.parameters.requestXPath); // Create 'primary key' object var pk := complex.primaryKeyOf(); // assign the value from the currently selected record's 'id' field to the objects 'id' parameter pk.id := currRecord.id; // If the user is considered 'not active', then delete // If they are active write an info message instead if currRecord.status = false then begin data.deleteRecordByPrimaryKey(tr, table, pk); end else log.info('Active users cannot be deleted.'); end end