FIRST Working Day of NEXT year in NAV 2017

Hi guys,

I hope you are passing a good time

Please can you help how can I calculate the FIRST Working Day of NEXT year. 

What I have so far: 

I have 2 fields in NAV in Table 36 Sales Header and also in Sales Order page("Order Date" which is standard and a new one "Order Intake Date"). 

In Sales & Receivables I added a new field: "Intake Date Setup" which is going to be entered manually. 

What I want to get in the end is :

1. If Order Date is within “Intake Date Setup”, the system should fill “Order Intake Date” same as Order Date.

2. IF the "Order Date" is above “Intake Date Setup” THEN the system should fill in “Order Intake Date” the FIRST Working Day of NEXT year. Taking this information from Calendar in NAV.

For the point 1 I achieved what I wanted by creating the code: 

IF "Order Date" <= SalesSetup."Intake Date Setup" THEN
"Order Intake Date" := "Order Date";

Please can you give me a hand how to realise the point 2?

 

Parents Reply Children
Related
Recommended