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 :
Microsoft Dynamics NAV (Archived)

OnInsert not triggered when inserting row

(0) ShareShare
ReportReport
Posted on by

When I insert a row into my lines subpage the OnInsert trigger is not triggerd.

When I run it individually from the developer environment it does trigger but when I run it as subform in my Head page it doesnt. 

Because of this problem no primary key is being assigned to my lines.

Any solutions? thanks in advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at

    when you insert records by code oninsert trigger is only run, when you use insert(true).

  • Community Member Profile Picture
    on at

    I don't insert it by code.. its through the client. When I close the page in the client the OnInsert triggers but not when I insert a new line.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    What table are you referring is this a custom table ? If you are using client it will always trigger INSERT trigger, compare you subpage with other standard page properties and add a message box in the trigger and check if it shows up or not.

  • Community Member Profile Picture
    on at

    It was a custom table, the problem must have been because of Navision itself. After restarting the service it seemed to work. Could the cause be that i forced a compile?

  • Suggested answer
    Rabin Profile Picture
    2,976 on at

    Hi,

    There can be various cause of problems like this. You did good by Restarting the service, this is what solved most of the issues :)

    Main point to note here is, You understand what you are trying to achieve, As adviced by [tag:Archer], if you are using code to insert then, in order to run through the code in Oninsert trigger, always pass "True" argument while calling oninsert trigger function.

    Also make sure the subforms are properly linked to the main page. and not to forget is to compile each object.

  • Community Member Profile Picture
    on at

    Its the no. Series that is being assigned in the oninsert trigger. As you see by my second post the problem is back. Tonight i need to finish this project for school so I hope u can help mz find the solution. Changing the language or restarting the service sometimes help but this time not. The strange part is that i did not change the code that is linked to this no. series. It was very sudden..

  • Suggested answer
    Rabin Profile Picture
    2,976 on at

    You need to go through everything and list out the issues. Try Debugger and make a note.

    Double check the relation and codes, in case you might have commented any?

    TIP- the best way to solve the issue is to understand the issue. Panic will only give you stress.

  • Community Member Profile Picture
    on at

    Yes I am trying to search for the cause. Another indicator that it must be navision itself is that i exported the working tables and  pages. Now when i delete the last version and import the working exports I have the same problems.. Any ideas how i  could completely "reset" the database/client?.

    Thanks

  • Suggested answer
    Rabin Profile Picture
    2,976 on at

    Did you manage to use Debugger?

    What's the result of your debug session?

  • Community Member Profile Picture
    on at

    My project partner imported the tables and pages and it is working fine on her enviroment... must be Navision itself that is causing the problem..  I would like to know how i could prevent that from happening again. thanks for the help!

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans