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

Please help me solve this problem X++ IN (Customer payment journal)

(1) ShareShare
ReportReport
Posted on by 8
Hello, I have a question for those with experience.
 
I have this body and I send it to receive a payment in the "Customer payment journal" screen. The problem I have is that when I send the invoice number "PayInvoice": "FTI-00000009", the system does not understand it even though it exists for the customer "US-001" ..... The system does not understand it unless I cross out the invoice number and write it again or select it from the lookup ..... I want help with a way for the system to understand the invoice number in order to make a correct settlement between the payment amount and the invoice amount
 
 
 
And this is when the payment reaches the screen.
 
 
 
So I understood that he did not understand the invoice.
 
 
It works when I delete the invoice number and select it from the lookup again.
 
 
 
Please help me solve this problem
 
 
 
Categories:
I have the same question (0)
  • CU03061204-0 Profile Picture
    8 on at
    Please help me solve this problem X++ IN (Customer payment journal)
    Thank you Mr. "" for your advice.
    I tried this code.
     
     
     
    And it didn't work
     
     
    And
     
     
     
    If you have a code that solves this problem, I would be grateful to you. 
     
    This Code :
     
     private void autoSettleInvoice(LedgerJournalId _journalNum, CustAccount _custAccount, InvoiceId _invoiceId, Counter _lineNum)
     {
         try
         {
             changecompany(curext())
             {
                 // البحث عن حركة الدفعة مع forupdate
                 LedgerJournalTrans paymentTrans;
                 select forupdate paymentTrans
                 where paymentTrans.JournalNum == _journalNum
                    && paymentTrans.AccountType == LedgerJournalACType::Cust;
                 if (paymentTrans.RecId)
                 {
                     ttsbegin;
                 
                     // تحديث MarkedInvoice فقط
                     paymentTrans.MarkedInvoice = _invoiceId;
                     paymentTrans.Txt = strFmt("Payment for invoice %1", _invoiceId);
                     paymentTrans.update();
                     ttscommit;
                     info(strFmt("✅ Invoice %1 marked in payment journal %2", _invoiceId, _journalNum));
                 
                     // إضافة تعليمات للمستخدم
                     info(strFmt("📝 Please open journal %1 and click 'Settle transactions' to complete settlement", _journalNum));
                 }
             }
         }
         catch (Exception::Error)
         {
             warning(strFmt("Failed to mark invoice %1: %2", _invoiceId, infolog.text()));
         }
     }
     
    private void auto...

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

  • Sohaib Cheema Profile Picture
    48,482 User Group Leader on at
    Please help me solve this problem X++ IN (Customer payment journal)
    It appears you are trying to settle the payment with an invoice using x++, plenty of code available online for that, which can be found by googling
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    298,698 Super User 2025 Season 2 on at
    Please help me solve this problem X++ IN (Customer payment journal)
    Hi,
     
    Can you tell us how you import the lines from your source file into Dynamics 365 Finance? Are you using a standard data entity, a custom import script or something different?
     
    Note that when entering the value manually in the form, it will not only store the invoice number, but it will also mark transactions for settlement. You can check after the import if customer transactions are marked for settlement. You can do this by clicking on the menu item View marked transactions form the action bar above the lines grid. If the settlement exists, you can try to post it, otherwise review the import coding to add the markings for settlement.
  • André Arnaud de Calavon Profile Picture
    298,698 Super User 2025 Season 2 on at
    Please help me solve this problem X++ IN (Customer payment journal)
    Moved the question from the Dynamics 365 General to the Dynamics 365 Finance forum.
     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,339

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 600 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans