Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Assign value to custom field in VendTrans table on insert()

(1) ShareShare
ReportReport
Posted on by 160
Hi,
 
I have created a custom field(purchId) in vendTrans table. 
 
When I post journal through vendor payment journal, I want to assign value to purchId based on the transaction through insert() method of vendTrans table, 
 
Any suggestions on how this could be done? 
  • Martin Dráb Profile Picture
    232,996 Most Valuable Professional on at
    Assign value to custom field in VendTrans table on insert()
    That's a relation to a general ledger journal line, not to a purchase order.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    22,124 Super User 2025 Season 1 on at
    Assign value to custom field in VendTrans table on insert()
    Hi @Arbia,
     
    There are method in LedgerJournalCheckPost class.
    Ithink you can create a COC and add your business logic inside
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Martin Dráb Profile Picture
    232,996 Most Valuable Professional on at
    Assign value to custom field in VendTrans table on insert()
    Assigning a field value is trivial, but do you have the PurchId value in insert() method? If not, your design is wrong. You should analyze the scenario and then selecting the right place for your modification, rather then selecting a method and then wondering whether it can be done there at all.
     
    To me, the whole idea is suspicious. I would start by finding out what is the business requirement that someone wants to address by this particular code change. There may be a better solution.
     
    The relation between vendor transactions and orders isn't straightforward. For example, you may have a transaction for an invoice, but the invoice will include several orders. Or you receive a payment that isn't linked to any order at all.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,996 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans