How to allow a user to add new Journal records but, not to edit them

Version 1


    You wish to enable a user to be able to add / append records to the Journal but you do not wish to allow them the ability to edit the Journal.  In Configure Application > Users and Permissions > Roles and Permissions > Object Permissions you can set the Add, View, Edit, Delete options for a given object.   But to be able to Add an object, you must also enable Edit.  It is not possible using simple object permissions to enable only Add for an object.  This article describes how to use a logical field to determine if the record being edited is a new record or an existing record.



    This article uses the Journal.Notes object as an example, the process is valid for any object.   

    The IsNewRecord field already exists on the Journal.Notes object although you can create a similar field for other objects.

    In the Journal.Notes business object business rules
       Add an Initialization Rule: IsNewRecord = true
       Add a Before-save rule: IsNewRecord = false

    The IsNewRecord is true only until saved the first time.   Thus it is true only for a new record.   
    The Before-save rule = false makes sure that for all subsequent edits to the record IsNewRecord is false.

    Add Object Read-only Read-only rule  $(if IsNewRecord then false else true)    

    NOTE: other read-only rules for specific fields may override this rule allowing access to a specific field