June 8, 201213 yr Hi guys, I made a little script to protect fields from being modified (fields upon which I cannot put the option "prohibit modification on data entry") which triggers OnObjectEnter: Beep Show custom dialog ["Error!"; "This field is not modifiable!"] Commit Records/Requests[skip data entry validation; No dialog] Now let's say I make an invoice, I fill all the fields needed (customer's invoicing address, orderID, etc.) and when I'm done I'd like to have a button labeled "confirm Invoice" which triggers the script above on the invoice fields I just filled, so that the invoice I created is protected from future modifications. On script steps I can't see such a command, I was wondering if there's a way to accomplish this. Thanks a lot!
June 8, 201213 yr You can't assign a script trigger programmatically, but you can have your button set a status field like “InvoiceIsConfirmed” to a value ("1"), which the trigger script can check on. If [ MyInvoices::InvoiceIsConfirmed ] Commit Records/Requests[skip data entry validation; No dialog] Beep Show custom dialog ["Error!"; "This invoice has already been finalized and cannot be edited!"] Else Exit Script [] End If
June 8, 201213 yr so that the invoice I created is protected from future modifications. To protect records from modification use record level access restrictions. Script triggers work on field objects *on particular layouts*. There is nothing preventing the records from being changed from another layout.
June 8, 201213 yr Author Thanks for your replies guys. @eos: nice hint, I'll try to set up a script for invoice Confirmation that acts like you suggested. @Vaughan: shall I personalize record level access restriction from Manage DB-> Security? The thing is, I want the same user to be able to "create" an invoice record, fill it, confirm it and then to be able to just browse it later and not being able to modify it. edit: I got it Vaugham, I missed the tab "custom privilege sets" which clearly does what I need, I can set "create" "edit" etc. privileges based on db tables. Thanks!
Create an account or sign in to comment