Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Unanswered

To Run 1305 report as per the Customer document layout

Posted on by 100

Hi,

in customer card there  is an option to setup customer wise document layout.

but when I want run from Sale order for report 1305 for sell-to-customer , it is not working for custom layout. I am getting result for RDLC report.

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.

In sale Order

-----------------------------------

on page action
Salesquote.CustomerReportLayout("Sell-to Customer No.","Document Type",Segment);
COMMIT;
DocPrint.PrintSalesOrder(Rec,Usage::"Order Confirmation");

Function

-----------------------
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;

Can anyone help me

Warm Regards

Krish

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans