Add column to temp dataitem using report extension

ishwarsharma016
Member Posts: 50
Need to add Location Code to Sales Shipment report but the Sales Shipment Line is temp dataitem, is there a way to add the column using report extension?
0
Answers
-
What is the report number? Is it Report 208? If it is then Sales Shipment Line is not temp. Or Is it bespoke in your case?United Kingdom0
-
Any way , adding a column to a temp dataitem should be same as non temp dataitem using the report extension.United Kingdom0
-
First let see if I understand what you are trying to do: When processing a DataItem based on a temporary record you need to include additional columns to print data from the related physical record. The problem being that the report extension only has access the columns that were included in this DataItem from the base report. I also suspect those included columns are not sufficient to retrieve the related record.
How to solve:
1. When processing the DataItem for the physical record, save each record to a temporary table.
2. When processing the DataItem for the temp table, retrieve the physical record from your new temporary table and set you new columns as needed.
Example Code (Step 1)
modify("Sales Invoice Line")
{
trigger OnAfterAfterGetRecord()
begin
TempSalesInvoiceLine2 := "Sales Invoice Line";
TempSalesInvoiceLine2.Insert();
end;
}
Example Code (Step 2)
modify(SalesInvLine)
{
trigger OnAfterPreDataItem()
begin
NumberOfLines2 := TempSalesInvoiceLine2.Count;
OnLineNumber2 := 0;
end;
trigger OnAfterAfterGetRecord()
begin
CommentDesc := '';
if OnLineNumber2 < NumberOfLines2 then begin
OnLineNumber2 := OnLineNumber2 + 1;
if OnLineNumber2 = 1 then
TempSalesInvoiceLine2.Find('-')
else
TempSalesInvoiceLine2.Next;
There are no bugs - only undocumented features.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