how to insert 6 months contract period data when click action

Shivasai
Member Posts: 17
how to insert the data one table to another Customer have a 6 month Contract period when create the customer 1000 with 6 months contract that record should be save on contract list with 6 months records like jan,feb,march like until 6 month can you give me reference code if you any links also
likes this
Contract1 01-01-2021 10000 ******
Contract1 02-01-2021 10000 ******
Contract1 02-06-2021 10000 ******
likes this
Contract1 01-01-2021 10000 ******
Contract1 02-01-2021 10000 ******
Contract1 02-06-2021 10000 ******
0
Best Answers
-
I don't get you. I guess that you've a custom page where the user indicates the customer and the period of the contract and you want to insert in another table the first day of that month until the contract period expires. Am I right?0
-
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Answers
-
I don't get you. I guess that you've a custom page where the user indicates the customer and the period of the contract and you want to insert in another table the first day of that month until the contract period expires. Am I right?0
-
Yes, i want to insert in another table the first day of that month until the contract period expires0
-
The user indicates the number of months in period -> ContractPeriod, ContractDate (maybe by user or taken from the system)
int ContractPeriod := given by user;
date ContractDate:= given by user or today;
currentMonth:=DATE2DMY(ContractDate,2);
currentYear:=DATE2DMY(ContractDate,3);
newDate:=DMY2DATE(1, currentMonth, currentYear); //first day of current month
FOR i:=1 to ContractPeriod DO BEGIN
newDate:=CALCDATE('<+1M>', newDate);
tableContractDates.INIT;
tableContractDates.Customer:=Customer; //given by user
tableContractDates.Contract:=Contract; //given by user
tableContractDates.Date:=newDate;
tableContractDates.INSERT(TRUE);
END;0 -
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions