web
You’re offline. This is a read only version of the page.
close
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

X++ code to get all the customer payments which are posted for a date given

(0) ShareShare
ReportReport
Posted on by 184

Hi All,

I have a requirement where I need to pull all the customer payments posted for a date provided.

Can I have some x++ code for this please?

Thanks all in advance!!

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi D365 Wibes,

    Can you indicate if you need customer transactions without an invoice ID and negative amount, assuming it is a payment or are the payments always directly settled with the invoice?

  • D365_Wibes Profile Picture
    184 on at

    Hi Andre,

    Thanks for your response.

    I need payments always directly settled with the invoice.

  • D365_Wibes Profile Picture
    184 on at

    Also if would be helpful if you can suggest me both so that I can explore the both and see the difference.

  • Suggested answer
    BillurSamdancioglu Profile Picture
    19,854 Most Valuable Professional on at

    Hi,

    It can be hard to understand a transaction is a payment or not unless you have certain rules. I advise always  to use payment journals for this purpose.

  • D365_Wibes Profile Picture
    184 on at

    HI Andre,

    Could you please give some suggestions?

  • D365_Wibes Profile Picture
    184 on at

    Hi Billur,

    Can you please give some code for this ? I mean to pick up the posted payment journals

  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi D365 Wibes,

    In the CustTrans table, if the field InvoiceId is filled, it would be an invoice or credit note. When this field is not filled, it could be a payment , write off or correction. You would then need to know the source of customer transaction. Like Billur mentioned, this could be a specific payment journal.

    You can link two or more customer transaction records using the settlement details which are stored in the table CustSettlement.

  • BillurSamdancioglu Profile Picture
    19,854 Most Valuable Professional on at

    Sorry I am not a developer:) Komi Siabi ?

  • Suggested answer
    Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at

    Hi D365_Wibes ,

    Just like André said, Please you can get your records from the custTrans table.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans