Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

Assign value to custom field on insertion in table VendPackingSlipJour Table

Posted on by 154
  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... 290,252 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 154 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 228,089 Super User 2024 Season 2 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 154 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 228,089 Super User 2024 Season 2 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.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans