# How to remove data from outstanding transactions in automated payment processing

**URL:** https://www.dynamicsuser.net/t/how-to-remove-data-from-outstanding-transactions-in-automated-payment-processing/85564
**Category:** Developer Forum
**Created:** [July 22, 2024, 2:06am UTC](https://www.dynamicsuser.net/t/how-to-remove-data-from-outstanding-transactions-in-automated-payment-processing/85564 "2024-07-22T02:06:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![katsuya\_takahashi](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@katsuya\_takahashi](https://www.dynamicsuser.net/u/katsuya_takahashi)
#### Post date: [July 22, 2024, 2:06am UTC](https://www.dynamicsuser.net/t/how-to-remove-data-from-outstanding-transactions-in-automated-payment-processing/85564/1 "2024-07-22T02:06:45Z")

</div>

I am looking to process automated customer payments in a batch process.  
I have written the following code to do this, but when I run the batch process again, the same data is processed as the first time, because the data is not removed from CustTransOpen after the series of processes is completed.  
How can I remove it from CustTransOpen?

Below is the code used in the payment process.

```auto
                ttsbegin;
                SpecTransExecutionContext specTransExecutionContext = SpecTransExecutionContext::newFromSource(custTable);
                SpecTransManager specTransManager = SpecTransManager::construct(specTransExecutionContext.parmSpecContext());

                specTransManager.insert(custTransOpen.company(), custTransOpen.TableId, custTransOpen.RecId, custTransOpen.AmountCur, custTrans.CurrencyCode);
                ttscommit;
                ttsbegin;
                CustTrans::settleTransaction(specTransExecutionContext, CustTransSettleTransactionParameters::construct());
                ttscommit;

```

Anybody can help.  
Thanks.
