Need to change the status wen i give ok button in dialog box.

I need to change the status of the Transaction, once the checkout button is clicked.

I created a dialog box on checkout button using clicked method as:

db = box::yesNo(“Do you really want to checkout”, dialogButton::Yes, “Checkout”);
if (db == dialogButton::Yes)
{
// select forupdate axt
info( “We chose Yes”);
}
else
if (db == dialogButton::No)
{
info( “We chose No”);
}

But I don’t know how to change the status of tat transaction, please help how to do tat.

Thanks in advance

Hi Sri,

Please find the code below :

db = box::yesNo(“Do you really want to checkout”, dialogButton::Yes, “Checkout”);
if (db == dialogButton::Yes)
{
// Find below example.Add the below piece of code.Assign value to your datasource.field.This will update the value
axt.TransactionStatus = “Closed”;
info( “We chose Yes”);
}
else
if (db == dialogButton::No)
{
info( “We chose No”);
}

Its not working can you give me the code more specifically…

I tried like this:
if (db == dialogButton::Yes)
{
axt.Transaction_Status=Transaction_Status::Check_Out;
axt.update();
info( “We chose Yes”);
}

It showing an infolog as can’t edit a record.

This is my code in button clicked() and the name and date in my table TestTable is getting updated to “Sindhu” and 09/15/2017

void clicked()
{
DialogButton db;

super();

db = box::yesNo(“Do you really want to checkout”, dialogButton::Yes, “Checkout”);
if (db == dialogButton::Yes)
{
TestTable.Name = “Sindhu”;
TestTable.RmaInvoiceDate = today();
info( “We chose Yes”);
}
else
if (db == dialogButton::No)
{
info( “We chose No”);
}
}

Can you remove this line and try

axt.update();

Thanks, Sindhu:)

I done as:
if (db == dialogButton::Yes)
{
AX_TransactionHeader.Transaction_Status=Transaction_Status::Check_Out;
info( “You have successfully subscribed all the books”);
}
else
if (db == dialogButton::No)
{
info( “Transaction has been cancelled”);
}