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

How to change custom layout as per customer layouts

(0) ShareShare
ReportReport
Posted on by 116

I think there is some confusion in the communication
I have several report layouts (word) for one report example 1305. for example I have agreement (sales order) for prepaid contract and post paid contract. from the sale order I update layout code in 9657 table and I run report. It is okay working in Sales quote page but not in Sales order page.

on page action
Salesquote.CustomerReportLayout("Sell-to Customer No.","Document Type",Segment);
COMMIT;
DocPrint.PrintSalesOrder(Rec,Usage::"Order Confirmation");
External] CustomerReportLayout(CustNo : Code[20];Doctype : 'Quote,Order,Invoice';Segm : Code[10])
Segmas.RESET;
Segmas.SETFILTER("Segment Id",Segm);
IF Segmas.FINDSET THEN
BEGIN
IF (Segmas."Quote Report Layout"<>'') AND (Doctype=Doctype::Quote) THEN
BEGIN
custlay.RESET;
custlay.SETRANGE(Usage,18);
custlay.SETRANGE("Source No.",CustNo);
custlay.SETRANGE(Usage,custlay.Usage::"S.Quote");
custlay.SETRANGE("Report ID",1304);
IF custlay.FINDFIRST THEN
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Quote Report Layout")
ELSE BEGIN
custlay.INIT;
custlay.VALIDATE(custlay."Source Type",18);
custlay.VALIDATE(custlay."Source No.",CustNo);
custlay.VALIDATE(custlay.Usage,custlay.Usage::"S.Quote");
custlay.VALIDATE(custlay."Report ID",1304);
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Quote Report Layout");
custlay.INSERT;
END;
END;

IF (Segmas."Order Report Layout"<>'') AND (Doctype=Doctype::Order) THEN
BEGIN
custlay.RESET;
custlay.SETRANGE(Usage,18);
custlay.SETRANGE("Source No.",CustNo);
custlay.SETRANGE(Usage,custlay.Usage::"S.Order");
custlay.SETRANGE("Report ID",1305);
IF custlay.FINDFIRST THEN
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Order Report Layout")
ELSE BEGIN
custlay.INIT;
custlay.VALIDATE(custlay."Source Type",18);
custlay.VALIDATE(custlay."Source No.",CustNo);
custlay.VALIDATE(custlay.Usage,custlay.Usage::"S.Order");
custlay.VALIDATE(custlay."Report ID",1305);
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Order Report Layout");
custlay.INSERT;
END;
END;
END;

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    When you have a new layout developed for sales then you must provide the report id in Report Selection - Sales page, which will take care of printing the specified report automatically.

    Regards

    Avinash B

  • KrisMuthy Profile Picture
    116 on at

    There is big gap in my communication it seems

    There is a setup in customer card to setup Document layout. It means when can attach seperate report layout for each customer..  This setup information is  stored in table 9657 

    as shown below

    Source Type Source No. Usage Sequence Report ID Report Caption Custom Report Layout Code Custom Report Description
    18 BG-CS-10001 S.Order 8 1305 Sales - Confirmation 1305-000001 GAS - BULK
    18 BG-CS-10006 S.Order 3 1305 Sales - Confirmation 1305-000003 MMBS-CEU
    18 BG-CS-10006 S.Order 4 1305 Sales - Confirmation 1305-000003 MMBS-CEU
    18 BG-CS-10007 S.Order 4 1305 Sales - Confirmation 202-000001 New layout  BULK
    18 BG-CS-10010 S.Order 2 1305 Sales - Confirmation 1305-000001 GAS - BULK
    18 BG-CS-10011 S.Invoice 1 202 Sales Document - Test 202-000001 New layout  BULK
    18 K-19-0002 S.Order 7 1305 Sales - Confirmation 1305-000003 MMBS-CEU
    18 UID_A0051 S.Order 6 1305 Sales - Confirmation 1305-000001 GAS - BULK
    18 UID_A0055 S.Quote 9 1304 Sales - Quote 1304-000001 MMBS QUOTE

    When run report  1305 from sales order , the system should select as per the customer no (source no) . 

    Please advice if you have idea

    warm Regards

    Now I want pr

  • divyeshchitte Profile Picture
    970 on at

    You can design new reports according to the layout required by customer and add code to run the reports based on the table you have mentioned above.

  • KrisMuthy Profile Picture
    116 on at

    can you give me code to call the reports from 9657 table as mentioned above

    Warm regards

    Kris

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 674 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 359 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans