Add column to temp dataitem using report extension

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?
Thanks,
Ishwar Sharma

My Blogs: Dynamics Community Blog | Blogspot
Connect: Google + | Twitter

Answers

  • Developer101Developer101 Member Posts: 563
    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 Kingdom
  • Developer101Developer101 Member Posts: 563
    Any way , adding a column to a temp dataitem should be same as non temp dataitem using the report extension.
    United Kingdom
  • bbrownbbrown Member Posts: 3,268
    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.
Sign In or Register to comment.