Need to calculate return date automatically

To be return date needs to filled as maximum date based pn how many books customer subscribed…how can i do tat

Not sure what you are looking for. May be you can explain with an example.

if a user subscribed 4 books, his return date should be maximum of to be return date…

We already did to be return date based on pages, like tat…

If a user subscribed 4 books his return date will be like 9/20/2017, 9/25/2017,9/30/2017 and 10/5/2017…

I want the tobereturn date to be filled as maximum of this 4 date…

You can use maxOf in you select statement and assign it to toBeReturned date
Example - select maxOf(ReturnDate)

i did like this but it is not getting the value:
case fieldnum(AX_SubscriberLine,ToBereturnDate):
select maxof(tobereturndate) from axsl group by Sub_Id;

You have to select with proper conditions and the case should be for the field you are modifying currently (not the field you want to assign a value).
Example - select maxof(tobereturndate) from axsl where axsl .Sub_Id == this.Sub_Id

i tried its not getting the max date in tobereturndate field

So what does it returning? Try your code in a job or debug.

How to update the field in case:

case fieldnum(AX_SubscriberLine,ToBereturnDate):
select maxof(tobereturndate) from axsl where axsl.Sub_Id==this.Sub_Id;
// select forupdate axsl where axsl.ToBereturnDate

Maximum of each subscriber needs to set in the returndate field…

At what time it has to update or what action should update it?

It need to update the maximum of return date…

If the subscriber subscribed 4 books, he can’t come to return the single book alone so we need to assign the tobereturn date as max of 4books…

That doesn’t say when it has to update.
Example - when creating a record, or modifying/updating any value in the current record?

wen i create a record…

If i’m creating first subscribe details for an subscriber, it need to display the return date based on page…
wen i create second record it will have some returndate, like tat each record will have returndate for tat subscribe…

Wat i want to do is at the end i want all the tobereturndate to be modified to common date tat is max of returndate tat the subsciber subscribed…

You have your code either in insert (before super()) or after having the value in Sub_Id,
select maxof(tobereturndate) from axsl where axsl.Sub_Id==this.Sub_Id;

can you give me an example coding…

override insert on table,

select maxof(tobereturndate) from axsl where axsl.Sub_Id==this.Sub_Id;
this.tobereturndate = axsl.tobereturndate;
super();

I done this using modified field in line table by following code:

case fieldnum(AX_TransactionLine,TransDate):
select maxof(tobereturndate) from axtl where axtl.Trans_Id==this.Trans_Id;
update_recordset axt2 setting tobereturndate = axtl.ToBereturnDate where axt2.Trans_Id==this.Trans_Id;
break;

Thank you all for helping…