Hi! Is there any possibility to erase data from table if it is not allowed/denied? Still strugling with setting export… Janis. J.K.jr.
I’m sure that there are many ways to do that, but it depends on your “rules” of what is not allowed and when these rules should be “checked”!? e.g. you could put your “rules-check” in the OnValidate-Triggers of the “critical” fields, if the entry is not allowed, you simply can replace the Rec.FieldValue with the xRec.FieldValue (or delete the whole record) … Or you could create a batch job, that is checking & deleting the “not allowed” records, maybe time-triggered … or… or… Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP Edited by - stryk on 2001 Aug 11 17:45:02
quote:
Originally posted by puce: Hi! Is there any possibility to erase data from table if it is not allowed/denied? Still strugling with setting export… Janis. J.K.jr.
If in Code TableRec.MODIFY or TableRec.DELETE is called without a (TRUE) the OnModify or OnDelete triggers are not called. If you try to delete a shipped not Invoiced “Sales Line” from the form you get an error. OnDelete() TESTFIELD(“Qty. Shipped Not Invoiced”,0); Codeunit 80 Delete’s the sales lines by deleting with no trigger code called. SalesLine.DELETE; or SalesLine.DELETEALL; Tablerec.MODIFY(TRUE); // Run trigger Tablerec.MODIFY; // Do Not Run trigger or Tablerec.MODIFYALL(TRUE); // Run trigger Tablerec.MODIFYALL; // Do Not Run trigger A User may have Indirect permission to MODIFY or DELETE from the permissions set on a Codeunit or Report. David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk Edited by - David Cox on 2001 Aug 12 21:51:40
Remember in objects that insert/modify/delete posting-tables where it is not allowed, the developer has to give the permissions to the object. e.g. in codeunit 80 permissions to insert shipments/invoices. /Lennart
quote:
A User may have Indirect permission to MODIFY or DELETE from the permissions set on a Codeunit or Report.
Being new in Navision, how does this work ? Thx in advance.
Chong : You have got to set a property called permissions against the object who will update your tables. - Go and Check the permissions property of Codeunit 80, you should see something a bit similar to this : Object ID Object Name Read Permission Insert Permission Modify Permission Delete Permission 37 Sales Line No Yes Yes Yes 38 Purchase Header No No Yes No 39 Purchase Line No No Yes No 49 Invoice Post. Buffer No Yes Yes Yes 110 Sales Shipment Header No Yes Yes Yes 111 Sales Shipment Line No Yes Yes Yes 112 Sales Invoice Header No Yes Yes Yes 113 Sales Invoice Line No Yes Yes Yes 114 Sales Cr.Memo Header No Yes Yes Yes 115 Sales Cr.Memo Line No Yes Yes Yes 120 Purch. Rcpt. Header No Yes Yes Yes 121 Purch. Rcpt. Line No Yes Yes Yes 223 Drop Shpt. Post. Buffer No Yes Yes Yes 252 General Posting Setup No Yes Yes Yes ###### tarek_demiati@ureach.com