Register record of Sales Shipment/Invoice Line
edo906
Member Posts: 7
Hi,
I have a project for NAV2013R2 where i have to take some records of sales shipment line and sales invoice line and write them on custom table(with page action). Before this, the user can filter (when push the action page) records for POSTING DATE only month and year(for example if user set 04/2020, "process" write on the custom table only INVOICE OR DDT with POSTING DATE from 01/04/2020 to 30/04/2020)
How can do this??
Thanks so much and sorry for my bad english
I have a project for NAV2013R2 where i have to take some records of sales shipment line and sales invoice line and write them on custom table(with page action). Before this, the user can filter (when push the action page) records for POSTING DATE only month and year(for example if user set 04/2020, "process" write on the custom table only INVOICE OR DDT with POSTING DATE from 01/04/2020 to 30/04/2020)
How can do this??
Thanks so much and sorry for my bad english
0
Answers
-
Hello!
small example:
BeginDate - date
StartDate - Date
SalesInvLine - record on Sales Invoice Line
FilterDate - set by user/ Example 01/04/2020
BeginDate := CALCDATE('<-CM>', FilterDate);
EndDate := CALCDATE('<-CM>', FilterDate);
SalesInvLine.RESET;
SalesInvLine .SETFILTER("Posting Date", '%1..%2', BeginDate, EndDate)
IF SalesInvLine.FINDSET THEN
REPEAT
UNTIL SalesInvLine.NEXT = 0;1 -
Thanks for answer!!

But with your code, there is an error:
and then the date that set by user on filter on request page is only(Month/Year) without days... for example if i set 04/2020, take records of all April... if i set 05/2020, take records of all May
Thanks so muchAlexeyShamin wrote: »Hello!
small example:
BeginDate - date
StartDate - Date
SalesInvLine - record on Sales Invoice Line
FilterDate - set by user/ Example 01/04/2020
BeginDate := CALCDATE('<-CM>', FilterDate);
EndDate := CALCDATE('<-CM>', FilterDate);
SalesInvLine.RESET;
SalesInvLine .SETFILTER("Posting Date", '%1..%2', BeginDate, EndDate)
IF SalesInvLine.FINDSET THEN
REPEAT
UNTIL SalesInvLine.NEXT = 0;
0 -
User input month and year in different variables?
1 -
Yes, without days. Only month and year and then take all records in that month of the yearAlexeyShamin wrote: »User input month and year in different variables?
0 -
UserMonth - variable with month
UserYear - variable with year
BeginDate := DMY2Date(1, UserMonth,UserYear);
EndDate := CALCDATE('<CM>', BeginDate);
find out help about this function
https://docs.microsoft.com/en-us/dynamics-nav/dmy2date-function--date-0 -
Thanks!! But for transfer few fields to other table? I try this code on page action:
IF saleshipline.FINDSET THEN REPEAT ledger.ID_TRANSPORT_DOCUMENT := saleshipline."Document No."; ledger.ROW_TRANSPORT_DOCUMENT := saleshipline."Line No."; ledger.ID_INVOICE := saleshipline."Document No."; ledger.ROW_INVOICE := saleshipline."Line No."; ledger.INSERT; UNTIL saleshipline.NEXT = 0;
Var:
Name DataType Subtype Length
saleshipline Record Sales Shipment Line
ledger Record Ledger
But it didn't work.
Help me please
ThanksAlexeyShamin wrote: »UserMonth - variable with month
UserYear - variable with year
BeginDate := DMY2Date(1, UserMonth,UserYear);
EndDate := CALCDATE('<CM>', BeginDate);
find out help about this function
https://docs.microsoft.com/en-us/dynamics-nav/dmy2date-function--date-
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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