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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

how to separate method of payment on basis of its type ? (Check, cash..... etc.) SSRSreport D365fo x++

(0) ShareShare
ReportReport
Posted on by 226

I have used switch statement to separate payment on basis of their method , code is given below: 

 

  str cust =  custInvoiceJour.paymMode();
                        switch(cust)
                        {
                            case "CASH":
                                salesOrderInvoiceTmp.PaymModeCash       = custInvoiceJour.paymMode();
                                salesOrderInvoiceTmp.CashAmount         = custInvoiceJour.InvoiceAmount;
                                break;
                            case "CHECK":
                                salesOrderInvoiceTmp.PaymModeCheck      = custInvoiceJour.paymMode();
                                salesOrderInvoiceTmp.CheckAmount        = custInvoiceJour.InvoiceAmount;
                                break;
                            case "ELECTRONIC":
                                salesOrderInvoiceTmp.PaymModeElectronic = custInvoiceJour.paymMode();
                                salesOrderInvoiceTmp.ElectronicAmount   = custInvoiceJour.InvoiceAmount;
                                break;
                            case "PDC":
                                salesOrderInvoiceTmp.PaymModePdc        = custInvoiceJour.paymMode();
                                salesOrderInvoiceTmp.PDCAmount          = custInvoiceJour.InvoiceAmount;
                                break;
                            case "REFUND":
                                salesOrderInvoiceTmp.PaymModeRefund     = custInvoiceJour.paymMode();
                                salesOrderInvoiceTmp.RefundAmount       = custInvoiceJour.InvoiceAmount;

                                break;
                        }

Now I have a scenario if I have 5 methods of payment and system has updated 6th method ,then I have to update it manually through code in report . Is there any other way through which i can perform this validation in code whenever system updates a method it should automatically separate payment on basis of payment method.

 any suggestions?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, You need to write new switch case to handle new method of payments. It can't be automated.

    If your requirement is that if there is another method of payment apart from this then do something then add Default case.

  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi Junaid,

    Suppose there is a 6th method of payment added, Seems you have created new field for each method of payments.

    In that case you must need development for that if user created new method of payment.

    Thanks,

    Girish S.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 512 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans