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 :
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,827 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans