web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Stuck in a else if condition. Please help

(0) ShareShare
ReportReport
Posted on by 2

pastedimage1681898715921v1.pngits the condition required on a cell

now for condition before is 

else if(vendtrans.TransType != LedgerTransType::Payment && vendtrans.TransType != LedgerTransType::Settlement && vendtrans.DueDate <= toDate)

and condition after is (vendtrans.TransType == LedgerTransType::Payment , how these can be put together 

 else if(vendtrans.TransType != LedgerTransType::Payment && vendtrans.TransType != LedgerTransType::Settlement && vendtrans.DueDate <= toDate)
                   {
                       AdvToVend  = vendtrans.AmountMST;
                        cell  = null;
                        cell  = cells.get_Item(currentRow, 9);
                        cell.get_style().get_Numberformat().set_Format("0");
                        cell.set_Value(AdvToVend);
                   }

I have the same question (0)
  • Martin Dráb Profile Picture
    236,863 Most Valuable Professional on at
    RE: Stuck in a else if condition. Please help

    I don't understand your question. Please elaborate.

    By the way, I changed the category from Administration and Setup to Development / Customization / SDK, because your question clearly is about development.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,911 Super User 2025 Season 2 on at
    RE: Stuck in a else if condition. Please help

    Hi Sachin,

    When I try to understand your question, I think it should meet the first condition or the second condition. I'm ignoring the word Total in the description as I can only see the part of your coding where you share the if=statement. To combine them you can do it in the next way:

    else if ((vendtrans.TransType != LedgerTransType::Payment && vendtrans.TransType != LedgerTransType::Settlement && vendtrans.DueDate <= toDate)
        ||   (vendtrans.TransType == LedgerTransType::Payment))

  • Sachin Mittal Profile Picture
    2 on at
    RE: Stuck in a else if condition. Please help

    t should meet both conditions thats the problem and else if

    (vendtrans.TransType != LedgerTransType::Payment && vendtrans.TransType != LedgerTransType::Settlement && vendtrans.DueDate <= toDate

       &&   vendtrans.TransType == LedgerTransType::Payment)

    this will cause logical problem as one way i am choosing to payment transtype(but vendtrans.DueDate <= toDate with this conditions )and other way i also want transtype payment

  • André Arnaud de Calavon Profile Picture
    299,911 Super User 2025 Season 2 on at
    RE: Stuck in a else if condition. Please help

    Hi Sachin,

    Had you noticed my reply from several minutes ago? You might be writing your reply at the moment I was posting my thoughts.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade 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... 734 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 636

#3
Martin Dráb Profile Picture

Martin Dráb 553 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans