how to insert 6 months contract period data when click action

ShivasaiShivasai Member Posts: 7
edited 2022-09-22 in NAV Three Tier
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 ******

Best Answers

  • KTA8KTA8 MadridMember Posts: 339
    Answer ✓
    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?
  • krikikriki Member, Moderator Posts: 9,038
    Answer ✓
    [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!

Answers

  • KTA8KTA8 MadridMember Posts: 339
    Answer ✓
    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?
  • ShivasaiShivasai Member Posts: 7
    Yes, i want to insert in another table the first day of that month until the contract period expires
  • KTA8KTA8 MadridMember Posts: 339
    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;
  • krikikriki Member, Moderator Posts: 9,038
    Answer ✓
    [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!

Sign In or Register to comment.