Need to restrict the user not to delete when the status is in checkout

When the status is in open v can allow the user to delete the line, but once it has been changed to checkout need to make the user cant delete the line…

How can i do tat?

Thanks in advance

Override table level validateDelete() and write a condition if status == checkout, ret = false;

You can also disable delete button on form based on the status(have your code in the active method of the form data source)
Table_ds.allowDelete(false);

I tried this but its allowing me to delete:
public boolean validateDelete()
{
AX_SubscriberMaster axsm;
AX_BookMaster axbm;
AX_TransactionHeader axt;
AX_TransactionLine axtl;
boolean ret;
;
ret = super();
if(axt.Transaction_Status!=Transaction_Status::Open)
error(“Can’t delete the subscription”);

return ret;
}

ret = checkFailed(“Can’t delete the subscription”);

no its still allowing to delete

Its allowing me not to delete in Header but wat i want is not to delete the lines wen it is not in open state

You should check current record using this,
if(this.Transaction_Status!=Transaction_Status::Open)
You may also try disabling the button.

AX_TransactionLine_ds.allowDelete(false);
when i gave this its not allowing me to delete any record…

You have to check the Status

AX_TransactionLine_ds.allowDelete(AX_TransactionLine.Status==Transaction_Status::Open);

public int active()
{
int ret;

ret = super();
AX_TransactionLine_ds.allowDelete(AX_TransactionLine.Transaction_Status==Transaction_Status::Open);
//AX_TransactionLine_ds.allowDelete(
return ret;
}
I done but its still allowing me to delete the line wen the status is in open

You want the delete to be not allowed when the status is checkout right?

wen it is in open status i can delete the line, but rather than that user cant delete the line

also I have delete method in line, it makes the book to set available wen the books get deleted from line

public void delete()
{
AX_SubscriberMaster axsm;
AX_BookMaster axbm;
AX_TransactionHeader axt;
AX_TransactionLine axtl;
DialogButton db;
;
if(axt.Transaction_Status==Transaction_Status::Open)
{
db = Box::yesNo(‘Do you want to remove this book from transaction?’,DialogButton::No,“Remove book”,“Remove book from transaction”);
if(db){
super();
axbm.setAvail(this.Book_ID);
}
}
}

Do you mean this?
AX_TransactionLine_ds.allowDelete(AX_TransactionLine.Transaction_Status != Transaction_Status::Checkout);

it still allowing me to delete

you are not finding axt.

But how is this issue related to current issue?

Try copying this code in your line table validatedelete()

public boolean validateDelete()
{
AX_SubscriberMaster axsm;
AX_BookMaster axbm;
AX_TransactionHeader axt;
AX_TransactionLine axtl;
boolean ret;

ret = super();
if(this.Transaction_Status!=Transaction_Status::Open)
{
ret = checkFailed(“Can’t delete the subscription”);
}
return ret;
}

Please don’t combine multiple issues in a single thread. By doing so, your are making it difficult to understand/answer.

Ya I did tat like dis:
AX_TransactionLine_ds.allowCreate(AX_TransactionHeader.Transaction_Status==Transaction_Status::Open);
AX_TransactionLine_ds.allowDelete(AX_TransactionHeader.Transaction_Status==Transaction_Status::Open);