3 weeks ago
Request clarification before answering.
Hi @syedimran ,
If it is feasible, you can provide default values on the implementation of the action when you call it with null values.
Remove the mandatory annotation from the parameters:
action updateInvoices(InitialDate : Date @Common.Label:'Start Date',
FinalDate : Date @Common.Label:'End Date' );
Add default date calculation to the implementation of your action:
srv.on('updateInvoices', async (req) => {
if (req.data.InitialDate === null) {
// do the calculation of the first day of the month
}
if (req.data.FinalDate === null) {
// do the calculation of the last day of the month
}
});
Call you action:
/updateInvoices(InitialDate=null,FinalDate=null)
OData v4 itself doesn't seem to support default values for action parameters and it would be difficult to declare relative date calculations there.
Regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
29 | |
9 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.