I found a method that sender.get_commandArgument() can get the stored value in e.commandArguement. Then use split to get the targeted message.
function UnlockConfirm(sender, args) {
var commandArgument = sender.get_commandArgument();
var parts = commandArgument.split('|');
var recordNo = parts[2];
if (No != "") {
args.set_cancel(!confirm('Confirm to delete record' + No + '?'));
} else {
args.set_cancel(!confirm('Confirm to delete?'));
}
}