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, ...
Answered

Request for Assistance: Adding Custom Fields to CustCollectionLetterTrans

(0) ShareShare
ReportReport
Posted on by 60

Hello everyone,

I am currently trying to add two custom fields to CustCollectionLetterTrans.
826515.png

Since these fields need to be automatically populated as soon as a record is created, I assumed that I could use either the insert or the initFromCustCollectionLetterJour method to populate the fields. However, it seems that neither of these methods is being executed, according to the debugger.
8232765.png

After some research, I discovered the createCustCollectionLetterTransForJournalSetbased method in the CustCollectionLetterCreate class, which appears to write data to the CustCollectionLetterTrans.
75575.png

My question now is, how can I modify the insert_recordset section to also populate my two custom fields?

Thank you for your help.

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    You can't extend insert_recordset statement, you can't change code inside the standard method and you can't extend the method at all, because it's private. Either you'll find a different solution, or you'll need to ask Microsoft to make their code extensible.

    Note insert() method should be called even if insert_recordset is used, if insert() is overridden and skipDataMethods(true) wasn't called on the buffer before using it in insert_recordset. Of course, it would void benefits of insert_recordset, but maybe you're fine with it. What you're saying suggests that the system doesn't take CoC into account when determining whether insert() is overridden. What if you try an event handler instead?

  • Jakob Becker Profile Picture
    60 on at

    Thank you for your response and suggestion.

    I followed your advice and tried implementing a PreHandler on the CustCollectionLetterTrans.
    7167.Unbenannt.png

    However, it appears that also the PreHandler is not being executed.

    If anyone has any alternative suggestions or solutions to this problem, I would greatly appreciate it.
    Thank you for your time and assistance.

  • Suggested answer
    Jakob Becker Profile Picture
    60 on at

    I wanted to share an update on my previous post regarding adding custom fields to CustCollectionLetterTrans in Dynamics 365 Finance.

    After trying out the suggestions provided by the community, I have found an alternative solution using the DataEventHandler.
    I am happy to report that this solution works and allows me to populate the custom fields in CustCollectionLetterTrans upon record creation.
    3872.Unbenannt.png

    I want to extend my gratitude to Martin Dráb who offered his insights and support in helping me find a solution to this issue.

    I hope this update can help anyone else who may be facing a similar challenge.
    Thank you for your help!

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 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans