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 change custom layout as per customer layouts

(0) ShareShare
ReportReport
Posted on by 100

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;

I have the same question (0)
  • 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
    100 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
    968 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
    100 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

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