Need to change the status automatically

Hi,

I created a base enum with values checkin and checkout.

If a book is returned the field need to be change automatically to checkin.

I have a field as actual returndate when it is filled with date the status need to change as checkin.

How can i do tat in table method, please help

I think you are updating the return date based on the transdate, so update the status field at the same time.

no wen the actual return date field gets filled the status need to change as checkin…

to be returndate is different and actual return date field is different

You can have your code in update method of the table.

How kranthi, help me with the codinggg

override update method on table and have you code before super();

give an example for the above scenario with coding, please…

public void update()
{

ttsbegin;

if (this.returnDate)
{
this.status = YourEnum::Checkin; (I don’t know your enum name, so used it for example)
}

super();
ttscommit;
}

Hi,
Try Like this…

public void update()
{
super();
if(this.Ret)
{

this.selectForUpdate(true);
this.chk = CheckInOut::CheckOut;
this.doupdate();

}
}

You don’t have to select for update and doupdate, the super() does it. Just place your code before super();

If i fill any date in actualreturndate the status need to change Kranthi…

you can use that code and use what ever date you want in if condition.

I did in modified field like this:

case fieldnum(AX_Transaction,ActualReturnDate):
this.Book_Status=this.ActualReturnDate?Book_Status::Check_In:Book_Status::Check_Out;
break;

and it worked…

Thank you Kranthi:)

Hi Kranthi,
Thanks for your reply…