I tried below code , 1st line is working but second is not working 171: Modify Object Voucher,##CurrVchId).Narration : "Voucher Canceled" 180: MODIFY OBJECT : (Voucher,##CurrVchId).ISCANCELLED : "yes" Can anyone help me to cancel a voucher using a function ?