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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

items table records that are used in other tables are being deleted when i try to delete the records that are not used.i want to delete only those records which are not used.

(0) ShareShare
ReportReport
Posted on by 12

Hello All

I have created a table called MODEL and I have created a page called MODEL VERSION LIST and MODEL VERSION CARD whose source table are ITEM table.I have also created a page called MAKE LIST and MAKE MODEL whose source table are MODEL table.The field Model Code are used in ITEM and MODEL table as well.

What I am trying to do is, I am trying to delete the item record from the MODEL VERSION LIST that are not used in ITEM table.

I have written the code on MODEL table in OnDelete trigger as

item.setrange("model code","code");

if item.findfirst then begin

ERROR('The model code is in use.It cannot be deleted from the item table');

end;

But the code does not seem to be working at all.

*This post is locked for comments

I have the same question (0)
  • mmv Profile Picture
    11,471 on at

    Hi,

    Where the above code is written?  Table or Page?

  • Verified answer
    keoma Profile Picture
    32,729 on at

    when you remove a model record, do you call delete or delete(true)? the ondelete trigger is only called, when delete(true) is used.

  • Sulav Thapaliya Profile Picture
    12 on at

    The problem has been solved now.

    Thank You For Your Concern.

  • Sulav Thapaliya Profile Picture
    12 on at

    The problem has been solved.

    Thank you for your concern

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans