how to avoid user to delete the posted document?

julkifli33julkifli33 Member Posts: 1,087
hi all... i have a question
how to avoid user to delete the posted document?
i have an issue... i think there is a user that deleted the posted sales invoiced
and now we cannot track who did it?
is there a way ?
thanks

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    There's a property DeleteAllowed on the form. Did you try this?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • julkifli33julkifli33 Member Posts: 1,087
    There's a property DeleteAllowed on the form. Did you try this?
    i havent tried this one
    this one is good for me but is there any setting which prevent user delete the posted document/
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    through roles and permissions also you can restrict..
    remove delete access for posted tables for particular roles..
  • julkifli33julkifli33 Member Posts: 1,087
    through roles and permissions also you can restrict..
    remove delete access for posted tables for particular roles..
    ow ok the roles
    thanks a lot
  • Alex_ChowAlex_Chow Member Posts: 5,063
    julkifli33 wrote:
    hi all... i have a question
    how to avoid user to delete the posted document?
    i have an issue... i think there is a user that deleted the posted sales invoiced
    and now we cannot track who did it?
    is there a way ?
    thanks


    Put on the OnDelete trigger of the table:
    ERROR('STOP!!!!');
    
  • julkifli33julkifli33 Member Posts: 1,087
    Alex Chow wrote:
    julkifli33 wrote:
    hi all... i have a question
    how to avoid user to delete the posted document?
    i have an issue... i think there is a user that deleted the posted sales invoiced
    and now we cannot track who did it?
    is there a way ?
    thanks


    Put on the OnDelete trigger of the table:
    ERROR('STOP!!!!');
    
    so simple and it works
    thanks :)
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    julkifli33 wrote:
    There's a property DeleteAllowed on the form. Did you try this?
    i havent tried this one
    this one is good for me but is there any setting which prevent user delete the posted document/

    This was also simple..what was the issue with this?
  • julkifli33julkifli33 Member Posts: 1,087
    julkifli33 wrote:
    There's a property DeleteAllowed on the form. Did you try this?
    i havent tried this one
    this one is good for me but is there any setting which prevent user delete the posted document/

    This was also simple..what was the issue with this?
    yes this is also simple...
    but i need to set it in the table
    so i dont have to set for each form/page
  • DenSterDenSter Member Posts: 8,305
    julkifli33 wrote:
    There's a property DeleteAllowed on the form. Did you try this?
    This was also simple..what was the issue with this?
    yes this is also simple...
    but i need to set it in the table
    so i dont have to set for each form/page
    Exactly :mrgreen: =D>
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    As far as I know there's only one Form for each Posted Document Type where deletion is allowed. So the effort should be nearly the same. And most customers do not have access to the Table Designer. But anyway... I think there're many roads that lead to Rome and it depends on your individual situation what's the best solution for you.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • SavatageSavatage Member Posts: 7,142
    This is another one of our Setup Table Additions too.
    Sales & Receiveable Setup
    New Boolean = "Block Deletion Of Posted Documents"

    Then on Table
    OnDelete()
    SalesSetup.Get;
    If SalesSetup."Block Deletion Of Posted Documents" then
    ERROR('You are not allowed to delete Posted Documents');

    That way authorized people can turn it on & off if needed without having to go back to change the code.
  • DenSterDenSter Member Posts: 8,305
    As far as I know there's only one Form for each Posted Document Type where deletion is allowed. So the effort should be nearly the same. And most customers do not have access to the Table Designer. But anyway... I think there're many roads that lead to Rome and it depends on your individual situation what's the best solution for you.
    Yes there are many roads to Rome. The point though is that business logic should be triggered by the data, not the form that the data happens to be on. Whether you are allowed to delete a record from a certain table should not be decided by which form you are on. What will happen if certain users need to be able to delete that data anyway, more code on the form? Programming (I consider setting properties as programming) business logic in forms just makes managing the application needlessly complex.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    DenSter wrote:
    As far as I know there's only one Form for each Posted Document Type where deletion is allowed. So the effort should be nearly the same. And most customers do not have access to the Table Designer. But anyway... I think there're many roads that lead to Rome and it depends on your individual situation what's the best solution for you.
    Yes there are many roads to Rome. The point though is that business logic should be triggered by the data, not the form that the data happens to be on. Whether you are allowed to delete a record from a certain table should not be decided by which form you are on. What will happen if certain users need to be able to delete that data anyway, more code on the form? Programming (I consider setting properties as programming) business logic in forms just makes managing the application needlessly complex.
    Yes, I'm totally with you. I know about the issues behind. But I can also think of situations where it is easier to go another road and someone decides that it is worth to bear the consequences of that road. That's why I said it depends on your individual situation what's the best solution for you.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.