web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Add Extension Field to a Sales Quote Layout

(0) ShareShare
ReportReport
Posted on by 115

Hi all,

I have manged to successfully create several field and page extensions within Business Central all of which seem to work as designed. However, I now need to add these fields to the Sales Quote Layout and am struggling to work out how I can add these to the XML file stored within the word template, which I was hoping would be a simple task.

Is it a case of creating a new report extension and include all the fields I need and use this to create the layout using this and if so can this still be achived in Word or will i need to use a RDLC file and Report builder?

Sorry for all the simple questions but we are very new to this our first implementation of Business Central with little Nav experience either so have a lot to learn!

Thanks

Phil

I have the same question (0)
  • Daniel Rimmelzwaan Profile Picture
    3,485 on at

    In order to see the field in Word (or RDLC for that matter), you have to first add it to the dataset. The dataset is defined in the report object. Unfortunately, there is no 'report extension' object, so you will need to make a copy of the standard report and then add your new field to the copy and go from there. 

  • pmoorey Profile Picture
    115 on at

    Thanks Daniel. appreciate the quick response. I have created a copy but the bit I am really struggling with is how I physically add my field to the XML Mapping so that I can select it. Do I need to create a new report dataset in AL or can I just add some new XML via the word developer XML mapping?

  • Daniel Rimmelzwaan Profile Picture
    3,485 on at

    The report itself has a property called 'WordLayout' that defines the layout file in Word format, and a property 'RDLCLayout' that points to the RDLC Layout file. In order to get new fields into the layout file you have to build the AL workspace by either F5 or Ctrl+F5 or by using AL:Package from the command palette. This will update the available fields in the Word file and you should see them in the XML mapping in Word.

  • pmoorey Profile Picture
    115 on at

    Thank you for your response, however I feel that I am missing something fundamental in the process.

    I have created a new extension on the Sales Quote header which seems to be working as designed. I have then loaded the Report Layout Selection screen, highlighted report 1304 Sales Quotes > Action > Custom Layouts. From the Custom Layout Screen, I have inserted a new Word Report Layout and changed the Description to Test Quote.

    Returning to the Report Layout Selection I have changed 1304 Sales Quote to a Custom Layout and selected the newly created Test Quote as the Custom Layout Description.

    The next stage as suggested I have returned to Visual Code and F5 my initial extension code, returned to the Custom Layouts and Exported my new layout. Under the XML Mapping I have loaded urn:Microsoft-dynamics-nav/reports/standard_sales_quote/1304/ but none of the newly created fields are listed.

    Should this read urn:Microsoft-dynamics-nav/reports/Test _quote/1304/ ?

    All this is currently being processed in the sandbox. Sorry for the simplistic instructions but I rather people didn’t assume I had done something that I haven’t and as mentioned earlier, I feel I am missing a fundamental step like manually creating a new report dataset.

    Once again thank you for taking the time to try and assist me.

  • Suggested answer
    THE Italian Profile Picture
    on at

    It will not work this way.

    You must create a totally brand NEW report copying report 1304. It does not exists, at the moment, a report extension or a dataset extension or whatever you want to call it.

    Within this NEW report you have to add the columns that you need in the dataset (dataitems) and these will be available to be selected in the word layout.

  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at

    Here's an example on how to do it:

    https://thinkaboutit.be/2019/02/how-do-i-add-fields-to-a-report-in-business-central/

    As already suggested here, you need to create a totally new report, which can be a copy of the existing one that you rename, renumber and then you can add your field to it's dataset and layout(s).

  • Daniel Rimmelzwaan Profile Picture
    3,485 on at

    Hey Phil

    I was going to create something to show you exactly how it works but Steven's post explains it all. As far as making assumptions - I don't know you yet and what you can do so I usually start with jut a little information and add more as is needed. I've written so many very long replies explaining all the details only to discover that the person already knew most of it. Useful for the community and I'm happy to help, but not for the person asking the question. Just keep doing what you're doing and writing thoughtful questions like this, and we will figure out how much help you need. You will be the one helping other people in no time

    Let us know if Steven's link helps or if you need more details. 

  • pmoorey Profile Picture
    115 on at

    Thanks a lot guys you have all been really helpful .... what a great community this is!

    Ok, I am getting somewhere I think, I have managed to install an on premise version on my laptop and opened the StandardSalesQuote.al file in visual code. i have then copied this code changed the id etc to 50100 added my required fields, deployed . added this back into BC at report ID 50100 and all works great.

    However the system calls report ID 1304 when printing a quote and the system will not allow me to import my document as 1304 and returns an error 

    pastedimage1591199877814v3.png

    Thanks for the info Steven, I have also tried to follow your instructions but the local install I have doesn't seem to include the finsql.exe or the txt2Al.exe you mention, however my opening the Al file for the standard layout in visual code then I am hoping that I can miss this stage?

    Cheers

    Phil

  • Verified answer
    Daniel Rimmelzwaan Profile Picture
    3,485 on at

    My guess is that you did not change Report Selection to use your custom report, and you are trying to import your new layout into the standard version.

    Business Central has functionality to set up which report object is used for certain functions. In general this is called 'Report Selection', and there are a number of them throughout the app. For sales you would need to use 'Report Selection - Sales'. Hit Alt+Q to get to the search box and start typing that, you should see it pop in. Click on the dropdown next to 'Usage' and select 'Quote', and now you should see the detail in the bottom, and you would not be surprised to see report number 1304 in there.

    pastedimage1591236549313v1.png

    This means that when you hit 'Print' from a sales quote, the system will look in Report Selection to see which report to use, and it will pick 1304 because that's what is defined. What you need to do is remove that line and replace it with the report number that you used for your copy.

    Now to import your custom layout, you need to link that to the right report object as well. Under 'Custom Report Layouts' you should see your new number in the list. I am guessing that you are trying to import the custom layout into report 1304 which will fail because you are using a field that doesn't exist in that report.

    pastedimage1591236695728v2.png

    I don't think you even need to import the report layout because if you created a new report object, and you created a custom Word or RDLC layout for that report, everything should just be part of your app, and when you install that app into BC, it should work because the layout is just part of your app. Another thing that might have gone wrong is that you did not include the report layout in your workspace when you built your app file, or you didn't build it after you modified the layout.

  • pmoorey Profile Picture
    115 on at

    Fantastic all working a treat , thank you so much. I think the time it took to me to get the layout up and running and in the excitement of this actually working, I forgot to assign the default layout in the Report Selection - Sales.

    argggghh Schoolboy error, a lesson I will now remember!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans