Export to Excel - Business central 365 Wave 2

rnjbngrnjbng Member Posts: 82
Hi folks -

I have a processing only report with 2 data items and a procedure Makedatabody. I get the errors that Sales shipment header and Sales shipment line does not exist. Can anyone please let me know how do i refer to a field in 365 BC. Many..Many thanks for your help.

Sales shipment header
Sales Shipment Line

procedure MakeDataBody();
begin
ExcelBuf.NewRow;
IF i = 1 THEN BEGIN
ExcelBuf.AddColumn("sales shipment line"."Document No.", FALSE, '', TRUE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line"."Document Date", FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Date);
END ELSE BEGIN
ExcelBuf.AddColumn('', FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn('', FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
END;
ExcelBuf.AddColumn("sales shipment header"."Shipment Method Code", FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line"."Order No.", FALSE, '', TRUE, FALSE, FALSE, '[RED]', ExcelBuf."Cell Type"::Number);
ExcelBuf.AddColumn(FORMAT("Sales Shipment Line".Type), FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line"."No.", FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line".Description, FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line"."Shortcut Dimension 2 Code", FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Header"."Location Code", FALSE, '', FALSE, FALSE, FALSE, '', ExcelBuf."Cell Type"::Text);
ExcelBuf.AddColumn("Sales Shipment Line".Quantity, FALSE, '', FALSE, FALSE, FALSE, '#,##0', ExcelBuf."Cell Type"::Number);
ExcelBuf.AddColumn("Unit Price", FALSE, '', FALSE, FALSE, FALSE, '#,##0.00', ExcelBuf."Cell Type"::Number);

ERROR
The name '"Sales Shipment Header"' does not exist in the current context
The name '"Sales Shipment Line"' does not exist in the current context


Thanks
RJ.

Comments

  • rnjbngrnjbng Member Posts: 82
    I figured this out folks, please ignore my post.
Sign In or Register to comment.