Create a Transaction List/Record field.
Write a user event script.
Within beforeLoad :
let customerRefundId1 = context.newRecord;
let credit = customerRefundId1.getValue({ fieldId: ‘entryformquerystring’ });
let credId = extractCredId(credit);
function extractCredId(inputString) {
var credMatch = inputString.match(/cred=(d+)/);
return credMatch ? credMatch[1] : null;
}