```function unlinkBankDetailsRecord(recordId) { ...
# suitescript
c
Copy code
function unlinkBankDetailsRecord(recordId) {
    try {
        record.submitFields({
            type: 'customrecord_2663_entity_bank_details',
            id: recordId,
            values: {
                custrecord_2663_parent_employee: ''
            }
        })
    } catch (e) {
        log.debug('Error unlinking parent record', e);
    }
}
This code removes the bank details from the record (I think it's from the payment processing bundle); anyone know why it removes the fields and if the data from the fields exists anywhere else?
a
Its part of the Electronic payments bundle, which itself I think is a prerequisite for a bunch of other bundles
the bank details record is a child record of entity records (vendor/customer/employee)
if you remove the parent reference on the child... it ceases to be linked to the parent... in this case the employee record
c
There's a requirement to delete all bank details in all SB environments. I'm thinking of pushing back on this to be honest.
I'm guessing the details would still be present in the system information anyway
a
you can brute force it pretty easily by just deleting all the bank details reacords
c
Until they have related transactions
then they won't delete so easily
e.g. Bill Payment
a
I'm not sure the bank details are directly associated like that?
there's multiple records involved in the batch payment process... its been a while since i worked with it tho
anyway, if you can't "delete" them you can just set all their values to 12345678 or w/e
there's also delete PII functionality now? i remember NS added that... I've never actually used it tho, maybe this is a good use case for that?
c
Never used that either - might look into it and see what it can do.
At least one of these related records will 100% stop the bank details record being deleted though.
👍 1