Item Ledger Entry

lloyd
lloyd Member Posts: 12
Before writing a record to the item ledger entry I want to test if the item has an item tracking code. If it doesn't I want to ask the user if the item should be item tracked before creating the record as you cannot change the item tracking code after the record exists.

My issue is that the OnInsert trigger on the Item Ledger Entry table doesn't execute so the code to check the item details doesn't run.

Does anyone know where I should place the check?

Comments

  • kine
    kine Member Posts: 12,562
    To the CU 21 - there is place for tests before posting... do not insert Confirm after begin of transaction...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSter
    DenSter Member Posts: 8,307
    You should never write any code that creates Item ledger entries directly. Instead, you should create an Item Journal line and post it through the standard posting routines. Those already have checks like that embedded.
  • lloyd
    lloyd Member Posts: 12
    Thanks Kine. Problem solved.