Notifications
Announcements
No record found.
Hello everyone, I am currently trying to add two custom fields to CustCollectionLetterTrans. 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. After some research, I discovered the createCustCollectionLetterTransForJournalSetbased method in the CustCollectionLetterCreate class, which appears to write data to the CustCollectionLetterTrans. My question now is, how can I modify the insert_recordset section to also populate my two custom fields? Thank you for your help.
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?
Thank you for your response and suggestion. I followed your advice and tried implementing a PreHandler on the CustCollectionLetterTrans. 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.
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. 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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 565 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader