web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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 166
  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. 
I have the same question (0)
  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at
    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.
  • Ariba Mehdi Profile Picture
    166 on at
    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
    237,882 Most Valuable Professional on at
    I know that VendPackingSlipJour is a standard table.
     
    Can you answer my questions, please?
  • Ariba Mehdi Profile Picture
    166 on at
    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. 


  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at
    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans