Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Stuck in a else if condition. Please help

(0) ShareShare
ReportReport
Posted on by

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);
                   }

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 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.

  • 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

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 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))

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 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.

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans