Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

EventSubscriber for new item creation

Posted on by 25

I am trying to detect when a new item is created in Business Central Cloud v21.

I looked at OnAfterOnInsert in the item table but that triggers when the new item card is originally shown and given a generic ITEM*** number.

What I am looking for is the trigger after that initial item card is completed.

Categories:
  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: EventSubscriber for new item creation

    hello

    recod insertion happens cmq when the primary key is inserted
    from the page can be delayed with the DeleayInsert property to TRUE

    community.dynamics.com/.../what-is-delayed-insert-and-how-it-works

    DAniele

  • Suggested answer
    Sabina Sasu Profile Picture
    Sabina Sasu 19 on at
    RE: EventSubscriber for new item creation
    [quote user="bignadad"]What I am looking for is the trigger after that initial item card is completed.[/quote]

    If I understand correctly, you want to detect when the user completes filling in the item information. There is no trigger that detects this, however you could use the OnClosePage trigger on the Item card as a workaround.  Note that this trigger only works if users close the page using the back arrow, and not if they navigate to the previous or next item cards.

    Since the trigger runs every time a user closes the page, you can also create a new Boolean field like IsInformationCompleted on the Item table that toggles to true the first time the OnClosePage trigger runs to detect if this is the first time the item is created.

    Hope this helps!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans