Skip to main content

Notifications

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 212

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

  • Suggested answer
    YUN ZHU Profile Picture
    81,365 Super User 2025 Season 1 on at
    RE: if formula in custom report layout using the sales invoice reason code

    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

  • Suggested answer
    Vaishnavi J Profile Picture
    3,058 on at
    RE: if formula in custom report layout using the sales invoice reason code

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,099 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans