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

how to use a specific custom layout for a "type" of invoice?

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to know how I can use 2 different custom layouts based on some "type" of invoice.

NOT per customer, I really mean at the invoice level I want my finance team to select the layout they have to apply to my invoice.

we have 3 different processes in the company each one has some constraintys in term of invoice content and restrictions.

and for each of these processes we have a specific custom layout in place.

I could create 1 custom layout and add a bunch of condition into it, but it starts to be complicated to maintain, so if I can tell my invoice which layout to use it will be easier and this will allow us to add or change processes and layouts in the future.

thanks!!!

(same question for the credit memo)

I have the same question (0)
  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    Hi

    Does a method like below works for you?  https://yzhums.com/25943/

  • Jerome P1 Profile Picture
    on at

    oohhh... interesting.

    it's a good starting point I think.

    one of my constraint: we have some web service calls behind the scene calling BC to retrieve the PDF automatically.

    it's why I'm looking for something which selects the custom layout automatically.

    so my dream: no matter which interface is used, the right layout is used without any effort.

    but maybe I have no choice to create a custom web service which will select the right layout.

    and your sample code (thanks a lot) can be used for the interactive BC access (I can add or replace the print button to go through the select layout you provided)

  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    You are welcome. yzhums  is provided that solution

    Do you think it is possible to write a code to determine the right layout and enter it in a field on header? I mean if any logic involved to select the right template then maybe you can write a code to replicate that logic and enter it in a field on header. Than make your report print code or webservice to look into that field to determine the right template to request or use.  

  • Jerome P1 Profile Picture
    on at

    I think (I have to confirm) we have some custom fields  already in place which can be used to identify the type of layout.

    and so, yes, we should be able to have some logic in place to read this field, identify the right layout to use

    Some design decision were taken without considering the multiple layout constraint, so I have to validate what can be done or not.

    (like read only fields, which may be changed to read write access...)

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