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

Announcements

News and Announcements icon
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 6

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
    240,517 Most Valuable Professional on at

    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
    306,846 Super User 2026 Season 2 on at

    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
    6 on at

    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
    306,846 Super User 2026 Season 2 on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
SajeedMullaji Profile Picture

SajeedMullaji 760

#2
Martin Dráb Profile Picture

Martin Dráb 330 Most Valuable Professional

#3
CU10121822-0 Profile Picture

CU10121822-0 310

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans