Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Assign value to custom field on insertion in table VendPackingSlipJour Table

(1) ShareShare
ReportReport
Posted on by 160
  Hi guys,

I have added a custom field to VendPackingSlipJour table. Now I want to assign the value of my custom field every time the data is inserted into this table. I have tried to use insert, create, write and relevant methods on table level as well as on FormDataSource level. However, nothing happens. I have tried debugging, but the debugger doesn't hit these methods as well. Currently, I am assigning the value to my custom field through active method on FormDataSource level. 
I have also tried using PurchPackingSlipJournalCreate.initHeader() and initFromPurchTable method present in VendPackingSlipJour table.

I want to know from exactly which method or class, the data is inserted in table VendPackingSlipJour.  

I'd appreciate any help or suggestion. Thank you in advance. 
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,661 Super User 2024 Season 2 on at
    Assign value to custom field on insertion in table VendPackingSlipJour Table
    Hi Ariba,
     
    I would suggest using the debugger to check what happens when filling your custom field in the method initFromPurchTable() or initHeader(). Next to the reasons as mentioned by Martin, the insert might also be done using the method doInsert() which is also skipping the table methods.
    Martin made also a comment about incorrectly using the debugger. In the past, I wrote a blog about diabling Run business operations in CIL on the user options. You can read it here: Quick note on debugging in AX 2012 - Dynamicspedia
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    Assign value to custom field on insertion in table VendPackingSlipJour Table
    Version: AX 2012 R3 CU13

    Either I mark the breakpoints or write breakpoint;. 

    When I generate Product receipt in Receive. Product receipt in Journals opens the form VendPackingSlipJournal, having VendPackingSlipJour as the data source. 


  • Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    Assign value to custom field on insertion in table VendPackingSlipJour Table
    I know that VendPackingSlipJour is a standard table.
     
    Can you answer my questions, please?
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    Assign value to custom field on insertion in table VendPackingSlipJour Table
    Thank you for your response.

    VendPackingSlipJour is an out of the box table. I have added a new custom field to this table. I want to assign the value to that field before the insertion of the current record. For that, I need to know from which method or class method the record is inserted in this table. 
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    Assign value to custom field on insertion in table VendPackingSlipJour Table
    Which version of AX is it about?
     
    How are you adding records to the table?
     
    How are you debugging the code. For example, you may be using a wrong debugger in AX 2012 (X++ debugger when running code in CIL).
     
    insert() is called when inserting records, unless insert_recordset is used and with skipDataMethods.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,661 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans