FYI if your using this in payables or receivables or inv, etc etc.
I would add a field in the appropriate setup table that holds the value of 30. So it can be changeable on the fly if needed.
example/
Say this is about some item start date or something.
add a field to the inv setup table Like Adjust Days
your code would be something like
InvSetup.GET;
If Date1 < (Date2+ Invsetup."Adjust Days").....
Thank you for your response
But, is not accepted in this codition, an error message appear that indicates that's impossible to evaluate this condition :
"Due Date" is a field in the "Cust. Ledger Entry" table.
How can due date ever be Greater than itself plus some more days?
are you sure one of the "due date" shouldn't be document date or posting date?
IF Item."Discontinued Date" < (Item."Start Date" + 30) ...
Still worked in my test report - adding 30D instead of just 30 caused an error. Anyway I would still make "30 days" a variable that can be changed from some setup table.
We do something similar. Even tho an item is discontinued (blocked) we will allow it to be returned for (X) amount of days.
// CHECK FOR RETURNABLE
IF (Item.Blocked) AND (Item."Discontinued Date" <> 0D)
THEN DaysDiscontinued := WORKDATE - Item."Discontinued Date";
InvtSetup.GET;
IF (("Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"]) AND Item."Can Not Return") OR (DaysDiscontinued > InvtSetup."Days Blocked-Not Returnable")
THEN BEGIN
IF NOT CONFIRM ('Item Not Returnable. Do you want to add item anyway?')
THEN BEGIN
MESSAGE('Please Delete This Item');
END
END;
Where (X) is set in the Inventory Setup table in a field called "Days Blocked-Not Returnable". It's set this way just in case we one day want to increase or descrease the allowable time to return a discontinued item.
Comments
FYI if your using this in payables or receivables or inv, etc etc.
I would add a field in the appropriate setup table that holds the value of 30. So it can be changeable on the fly if needed.
example/
Say this is about some item start date or something.
add a field to the inv setup table Like Adjust Days
your code would be something like
InvSetup.GET;
If Date1 < (Date2+ Invsetup."Adjust Days").....
http://www.BiloBeauty.com
http://www.autismspeaks.org
But, is not accepted in this codition, an error message appear that indicates that's impossible to evaluate this condition :
Date AND Integer !!!
perhaps you should paste your code
Seems to work for me
http://www.BiloBeauty.com
http://www.autismspeaks.org
:whistle:
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
My code is:
"Due Date" is a field in the "Cust. Ledger Entry" table.
Try this and the help for CALCDATE will help you.
Technical Consultant, MS Dynamics NAV
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
How can due date ever be Greater than itself plus some more days?
are you sure one of the "due date" shouldn't be document date or posting date?
Still worked in my test report - adding 30D instead of just 30 caused an error. Anyway I would still make "30 days" a variable that can be changed from some setup table.
We do something similar. Even tho an item is discontinued (blocked) we will allow it to be returned for (X) amount of days.
// CHECK FOR RETURNABLE Where (X) is set in the Inventory Setup table in a field called "Days Blocked-Not Returnable". It's set this way just in case we one day want to increase or descrease the allowable time to return a discontinued item.
http://www.BiloBeauty.com
http://www.autismspeaks.org