Cancel Insert/Modify In Code

Hi,

I have a customer who centrally manages their item file and replicates it out a night. The local users should not have the ability to insert or modify the item file. However, they require the ability to run the cost adjustments batch job and the the ability to add planning criteria both of which require rights to the item table. I was thinking of trying to implement at least some of this through code; seeing as I can tell wether to database is local or head office is there any way through code of

  • cancelling an insert if the database is local.
  • allowing updates to certain fields.

Cheers

Whitey

You should be able to handle the cost adjustment part by permissions. First, find the cost adjustment report/codeunit and change it’s permission property to include Modify permission for the Item tabledata. Then, you will need to add a new permission for the users who will run the process. The permission should be for the Item tabledata and set the Modify column to Indirect. By using indirect, the user cannot directly modify the Item, but can “inherit” the permission that was granted to the object (report/codeunit) when it is executed.

I am not familiar with the planning process, but you may be able to use the same strategy.

Hope this helps