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 208

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?

  • Suggested answer
    GirishS Profile Picture
    27,823 Moderator on at
    RE: how to separate method of payment on basis of its type ? (Check, cash..... etc.) SSRSreport D365fo x++

    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.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: how to separate method of payment on basis of its type ? (Check, cash..... etc.) SSRSreport D365fo x++

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans