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...
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,062 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
    95,729 Super User 2025 Season 2 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

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 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans