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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

if formula in custom report layout using the sales invoice reason code

(0) ShareShare
ReportReport
Posted on by 309

Hello, 

I need to be able to control the Bank Account showing in the invoice template based on the reason code, but I'm having two issues: 

1. When I go to the template in word - developer tab - click XML mapping -> select the Sales Invoice 1306 in the XML custom part -> the reason code is not there to be added into the template

2. How could I add an IF formula there? I would need something like if("reasoncode"=AAR, "123", "345")

Thanks

Alejandra

I have the same question (0)
  • Suggested answer
    Vaishnavi J Profile Picture
    3,094 on at

    Hi AleAlonso 

    1. In Report 1306 there is no field Reason Code so you need to add field by creating Report Extension of Report 1306.

    2. In Word Layout report you cannot add IIF conditions but in rdl you can do that easily.

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • Suggested answer
    YUN ZHU Profile Picture
    99,456 Super User 2026 Season 1 on at

    Hi, Vaishnavi's suggestion is absolutely correct. Just adding a few more.

    1: You need to use ReportExtension Object to add new field to standard report. (APPLIES TO: Business Central 2021 release wave 1 (v18.0) and later)

    https://yzhums.com/10723/

    2: Word Layout doesn't support If formula, so you have to handle it in ReportExtension Object and then display the result on Word Layout.

    Hope this helps as well.

    Thanks.

    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,711 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 998 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 635 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans