I have a custom form and I have created a button to update the status of a field on the form. I overwrote teh clicked method on the button and wrote this code into it. my issue is this seems to update all the records on the form, what I need is for it to update only selected records
code:
class ApproveTestButton
{
public void clicked()
{
super();
VendorPaymentHeaderTable movVendorPaymentHeaderTable = VendorPaymentHeaderTable_ds.cursor();
{
if (VendorPaymentHeaderTable.VendPaymentApprovalStatus == VendPaymentApprovalStatus::Approved)
{
ttsbegin;
VendorPaymentHeaderTable.VendPaymentApprovalStatus = VendPaymentApprovalStatus::Approved;
VendorPaymentHeaderTable.update();
ttscommit;
}
else
{
info(/Payment is already approved./);
}
}
else
{
error(/No record selected./);
}
}