Need a script for conditional Sum in Form calc
I have a requirement as below.
The table has one header and two rows, one row is for repeating the Items in the transactions, and the other one is to display the total.
There is a field called Document Type, and when the value of this field is "Customer Invoice" and "credit Memo," then the total should be summed up from the field Original Amount.
The total should calculate in the next row.
I have tried multiple scripts; unfortunately, nothing works.
Path for Document Type
FormTradeReceivablesPayablesAccountStatementNotification.bdyPage1.frmTableBlock.tblOpenItemTable.rowOpenItems.coltxtTransaction
Original Amount
FormTradeReceivablesPayablesAccountStatementNotification.bdyPage1.frmTableBlock.tblOpenItemTable.rowOpenItems.coldecAmount
Total
FormTradeReceivablesPayablesAccountStatementNotification.bdyPage1.frmTableBlock.tblOpenItemTable.rowFooterRow.colCell5
Please refer to the below table for a better understanding.
| Item No | Product | Document Type | Original Amount |
| 10 | A | Customer Invoice | 100 |
| 20 | B | Payment | 20 |
| 30 | C | Credit Memo | 50 |
| 40 | D | Clearings | -10 |
| Total | 150 |
I tries with form calc, but that doesn't works.
Can someone help me on this.
Thanks.


