Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Business Central forum

Add currency code to purchase order template

(0) ShareShare
ReportReport
Posted on by

Hi,

I need to add the currency code to the purchase order report template. I've created a new custom report layout, selected the Purchase - Order 1322 report ID and ticked "Insert Word Layout". However, when I export the layout to Word I cannot see anything for the currency code in the XML mapping pane. Is there an additional step or something I need to change to include this?

Many thanks in advance

Daniel

  • Community Member Profile Picture
    on at
    RE: Add currency code to purchase order template

    Thanks for your help, I was hoping not to use Visual Studio Code though! Since I am only missing the currency code, I think we'll just manually enter it after printing the report for now.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Add currency code to purchase order template

    You need to use Visual Studio Code and AL, create new report ID XXX, create the dataitem and use the report layout that you've exported from D365BC.

    An example on how to create a report in AL:

    report 50110 CustomSalesOrder

    {

     DefaultLayout = RDLC;

     RDLCLayout = 'CustomSalesOrder.rdl';  <-- HERE YOU NEED TO USE YOUR REPORT LAYOUT

    dataset

    {

    // This is Sales Header DataItem

    dataitem("Sales Header";"Sales Header")

     {

       DataItemTableView=WHERE("Document Type"=CONST(Order));

       PrintOnlyIfDetail=true;

       RequestFilterFields="No.", "Sell-to Customer No.","Posting Date";  

        column(Sell_to_Customer_No_;"Sell-to Customer No.")

        {

        }

       column(CompanyName;CompanyName)

        {

        }

    // This is Sales Line DataItem

    dataitem("Sales Line";"Sales Line")

     {

       // DataItem Properties

       DataItemLinkReference="Sales Header";

       DataItemTableView=sorting("Document Type","Document No.","Line No.") order(ascending);

       PrintOnlyIfDetail= false;

       DataItemLink = "Document Type"=FIELD("Document Type"),"Document No."=FIELD("No.");

       // Adding Column from Sales Line Dataitem

       column(Quantity;Quantity)

        {

        }

        column(No_;"No.")

        {

        }

    // Sales Line DataItem Triggers

       trigger OnAfterGetRecord()

         begin

           if "Sales Line".Quantity = 0 then

           UnitePriceToPrint:=0

           else

           UnitePriceToPrint:=Round("Sales Line"."Line Amount" / "Sales Line".Quantity,0.00001);

           AllTotalAmount:=UnitePriceToPrint + UnitePriceToPrint;

           PaymentNewDescription:=PaymentTerms.Description;

           end;

     }

     // This is DataItem 1 Sales Header Triggers;

     trigger OnPreDataItem()

       begin

           PaymentNewDescription:=PaymentTerms.Description;

           CompanyName:=CompanyInfo.Name;

           end;

     }

     }

     trigger OnPreReport()

     begin

      CompanyInfo.Get();

     end;

    // All the Global Variable are here

    var

    CompanyInfo:Record "Company Information";

    UnitePriceToPrint :Decimal;

    CompanyName:Text [50];

    }

  • Community Member Profile Picture
    on at
    RE: Add currency code to purchase order template

    Hi Stefano,

    I'm not familiar with what steps that involves. Within Business Central how would I navigate to dataitem, and when I create a new custom report layout it does not seem to give any options to change the dataitem.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Add currency code to purchase order template

    You need to create a new report with a new dataitem and use the exported layout as the new report layout.

    You cannot "extend" an existing report.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans