Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
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
    295,377 Super User 2025 Season 1 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
    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
    234,161 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
    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
    234,161 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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans