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...
Answered

Unable to get multiple sales line item in sales invoice report

(0) ShareShare
ReportReport
Posted on by 76

I'm new to this BC. I have created report extension for sales invoice report. Once i run that report extension, i can able to see only one sales line, even though i have more than two sales line in my sales invoice page.

In my page extension i used trigger OnAfterGetRecord and performed some calculations for the fields which i created in table, my calculations are working, like if i placed the fields cgst, sgst, total in sales invoice page through page extension i can able to see the calculated values for cgst, sgst and total, but i.m unable to get those values in my sales invoice report. how to get cgst, sgst, igst and total with gst values in sales invoice report through report extension? 

tableextension 50126 requiredfieldstableheaderext extends "Sales Header"
{
    fields
    {       
        field(50012; PO_Number1; Code[100])
        {
            Caption = 'PO Number';
            DataClassification = CustomerContent;
        }
    }
}
tableextension 50127 requiredfieldstableext extends "Sales Line"
{
    fields
    {
        field(50001; Activity; Code[500])
        {
            Caption = 'Activity';
            DataClassification = CustomerContent;
        }
        field(50002; "Gross Amount"; Decimal)
        {
            Caption = 'Gross Amount';
            DataClassification = CustomerContent;
        }
        field(50003; "CGST"; Decimal)
        {
            Caption = 'CGST';
            DataClassification = CustomerContent;
        }
        field(50004; "SGST"; Decimal)
        {
            Caption = 'SGST';
            DataClassification = CustomerContent;
        }
        field(50013; "IGST"; Decimal)
        {
            Caption = 'IGST';
            DataClassification = CustomerContent;
        }
        field(50005; "Total"; Decimal)
        {
            Caption = 'Total';
            DataClassification = CustomerContent;
        }
        field(50014; "Total with IGST"; Decimal)
        {
            Caption = 'Total with IGST';
            DataClassification = CustomerContent;
        }       
        field(50011; TAX; Code[100])
        {
            Caption = 'TAX';
            DataClassification = CustomerContent;
        }
        field(50015; "S.No."; Integer)
        {
            Caption = 'S.No.';
            DataClassification = CustomerContent;
        }
pageextension 50126 requiredfieldspageheaderext extends "Sales Invoice"
{
    layout
    {
        addafter("Due Date")
        {           
            field(PO_Number; Rec.PO_Number1)
            {
                ApplicationArea = All;
            }
        }
    }
}
pageextension 50127 requiredfieldspageext extends "Sales Invoice Subform"
{
    layout
    {
        addbefore(Description)
        {
            field(Activity; Rec.Activity)
            {
                ApplicationArea = All;

            }
        }       
        addbefore("GST Assessable Value (LCY)")
        {
            field(TAX; Rec.TAX)
            {
                ApplicationArea = All;
            }
        }
    }

    trigger OnAfterGetRecord()
    begin
        Rec."Gross Amount" := Rec."Amount Including VAT";
        Rec.CGST := Rec."Amount Including VAT" * 0.09;
        Rec.SGST := Rec."Amount Including VAT" * 0.09;
        Rec.Total := Rec."Amount Including VAT" + Rec.CGST + Rec.SGST;
        Rec.IGST := Rec."Amount Including VAT" * 0.18;
        Rec."Total with IGST" := Rec."Amount Including VAT" + Rec.IGST;
    end;

}
   
reportextension 50127 requirefieldsext extends "Standard Sales - Draft Invoice"
{
    WordLayout = './StandardSalesDraftInvoice.docx';

    dataset
    {
        add(Header)
        {
            column(Customer_GST_Registration_No; "Customer GST Reg. No.")
            {

            }
            column(PO_Number1; PO_Number1)
            {

            }
        }
        addlast(Header)
        {

            dataitem("Company Information"; "Company Information")
            {
                column(GST_Registration_No_; "GST Registration No.")
                {

                }
                column(P_A_N__No; "P.A.N. No.")
                {

                }
                column(Home_Page; "Home Page")
                {

                }
                column(City; City)
                {

                }
                column(Post_Code; "Post Code")
                {

                }
            }

        }
        add(Line)
        {
            column(Activity; Activity)
            {

            }
            column(UNIT; "Unit of Measure")
            {

            }
            column(QTY; Quantity)
            {

            }
            column(RATE; "Unit Price")
            {

            }
            column(AMOUNT; "Line Amount")
            {

            }
            column(Gross_Amount; "Gross Amount")
            {

            }
            column(CGST; "CGST")
            {

            }
            column(SGST; "SGST")
            {

            }
            column(IGST; "IGST")
            {

            }
            column(Total; "Total")
            {

            }
            column("TotalwithIGST"; "Total with IGST")
            {

            }
            column("TAX"; TAX)
            {

            }
            column(No_; "No.")
            {

            }
            column(HSN_SAC_Code_; "HSN/SAC Code")
            {

            }
            column("SNo"; "S.No.")
            {

            }
        }       
    }
}
This is my word document layout.

CompanyAddress1

     

 

CompanyAddress2

 

CompanyAddress3

 

City

 

Post_Code

 

GST_Registration_No_

 

P_A_N__No

 

 

 

 

 

 

Tax Invoice

 

 

 

 

BILL TO

 

 

CustomerAddress1

CustomerAddress2

CustomerAddress3

CustomerAddress4

Customer_GST_Registration_No

Invoice No.

DocumentNo

DocumentDate_Lbl

DocumentDate

DueDate_Lbl

DueDate

PaymentTermsDescription_Lbl

PaymentTermsDescription

PO Number

PO_Number1

No.

HSN/SAC

ACTIVITY

DESCRIPTION

UNIT

QTY

TAX

RATE

AMOUNT

ItemNo_Line

HSN_SAC_Code_

Description_Line

Activity

UnitOfMeasure

Quantity_Line

TAX

UnitPrice

LineAmount_Line

 

                                                                                                      

Gross Amount

AmountExcludingVAT_Line

CGST@9%

CGST

SGST@9%

SGST

Total Including GST

Total

 

 

 

Beneficiary Name: 

CompanyAddress1

Bank Name:

CompanyBankName

Current Account No:

CompanyBankAccountNo

IFSC Code:

CompanyBankBranchNo

  • Revathi.T Profile Picture
    76 on at
    RE: Unable to get multiple sales line item in sales invoice report

    Yes. Initially i worked with my own word layout. But it does not work. Later i used standard report. Its working now. Thank you for your reply.

  • Verified answer
    Nitin Verma Profile Picture
    21,546 Moderator on at
    RE: Unable to get multiple sales line item in sales invoice report

    Hi,

    Are you working your own word layout or the standard one? I will suggest you take the standard word layout and changes there and then save it as your word layout.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Unable to get multiple sales line item in sales invoice report

    Hello,

    If you do not get further traction from the community, feel free to raise this issue to Microsoft via your partner or CSP.

    Thanks.

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 Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 374 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 247

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 231 Most Valuable Professional

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans