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 AX (Archived)

How to restrict data from deletion table

(0) ShareShare
ReportReport
Posted on by 30

Hi All,

As per customer requirement i made one form "POProductReceipt". This form opened from 2 locations :

1. Procruement and Sourcing

2. PO -- ALL PO -- Select any PO -- Open PO -- Then add button ( Product receipt print ).

In this form "POProductReceipt" i have used table ""POProductReceipt".

The requirement is after "POProductReceipt"print record should be deleted. So, i wrote code for delete in Form -- init() and canClose().

For this form ""POProductReceipt" i have created 2 menu items and call respectively..

**** My thinking is suppose user open the form from "Procruement and Sourcing" and insert 5 lines and in the same time some one open the same form from point no 2 ( PO...) then what will happened??

****Because i wrote for delete in Form -- init() and CanClose()

So, if the 2nd person going to open form then it will delete record from table ""POProductReceipt" and in the same time User1 is working in same form from "Procruement and Sourcing".

Shall i add userSession() with delete_POProductReceipt in where clause ?

So, i think it will restrict to delete data based on user connection. My concern is i want both user will work properly without any disturbance.

Please give me more shed on this.

Thanks!

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Why your customer want to delete product receipts?

    I see that leading to data inconsistency and probably playing with integrity of the system. It is very important document for almost any organization.

    Do yo mind asking your customer why they want to do so? Or may be you would want to copy/paste email of your customer here.

  • @rp@n Profile Picture
    30 on at

    No, it's only use for label printing. So, don't worry.

    I am not going to  delete Product receipt from actual table.

    In my form it's showing product receipt based on lookup. It's a completely new form and table.

    The form is only use for label printing

    Kindly suggest me how will manage based on above scenario.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,970 Super User 2025 Season 2 on at

    Hi Arpan,

    You can use temporary tables for this purpose. Then you don't have to manually delete it and the data is per session user. However, if you need the records in other processes, you might need to add logic to pass the temporary records or like you mentioned, use a persistent table and add the user or usersession field as distinction.

  • @rp@n Profile Picture
    30 on at

    Thanks Andre

  • @rp@n Profile Picture
    30 on at

    Hi Andre,

    The temp table like ( In Memory and TempDB ) both stored data based on current user and current session id ?

    Please give me more shed on this.

    Thanks!

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Temp tables are automatically dropped when decalred  variable   goes out of scope.    

  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,970 Super User 2025 Season 2 on at

    Hi Arpan,

    Yes both are doing the same job. If there are just a few records, you can use in memory. If the temp data  becomes larger, in memory will swap the data to disk. Then TempDB might be better.

  • @rp@n Profile Picture
    30 on at

    Thanks Andre and Sukrut

    I mean to say within scope only.

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 AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans