Working with Read-Only and Required Business Rules
21 min
overriding read only business rules docid\ dzatwdgrvzzx1my9orpd3protecting the read only field from override docid\ dzatwdgrvzzx1my9orpd3overriding the required business rule docid\ dzatwdgrvzzx1my9orpd3working with read only business rules docid\ dzatwdgrvzzx1my9orpd3 overriding read only business rules overriding the read only business rule from a quick action docid\ dzatwdgrvzzx1my9orpd3overriding the read only business rule from a role definition docid\ dzatwdgrvzzx1my9orpd3overriding the triggered actions business rule for locked business objects docid\ dzatwdgrvzzx1my9orpd3 when a field is applied with a read only business rule it becomes non editable, but it retains its control type therefore, set fields as read only (see creating a form docid\ jylkxqcbbnayk66grc2ty ), and remove the edit permission for the field from the object permission tab in the roles and permissions workspace overriding the read only business rule from a quick action from the configuration console, click build > business objects to open the business objects workspace open a business object click action menu > edit actions to open the quick actions center click the create new actions tab on the left choose update object in the field name field, choose readonly from the drop down list in the field value field, enter true update object quick action readonly field enter information into the other fields as needed click save users can choose this quick action to apply to the read only field on a specific business object record if the read only field is set up for that business object overriding the read only business rule from a role definition from the configuration console, click configure > users and permissions > roles and permissions to open the roles and permissions workspace from the role name column, choose the role for which to modify the read only rule the role details page appears choose the object permissions tab find the business object to override for this role, then click edit under the lifecycle column under when business object is in final state , check allow editing click save protecting the read only field from override use a global constant to manage server side validation of read only fields this ensures that fields set to read only by a business rule only accept updates via business rules, preventing users from updating fields using quick actions, templates, or role definitions without the approval of an it also allows administrators to control read only access at the field level enableserversidevalidationforreadonlyfields this global constant is set to true by default for all new ootb installations of the global constant is set to false for updates to existing installations when enabled, it allows server side validation of the read only field, configured at the field level to enable the global constant when it is set to false, go to the configuration console and select build > global constants find the enableserversidevalidationforreadonlyfields global constant and set the value to true managing server side validation for read only fields server side validation allows s to lock a read only field for users to prevent updates using quick actions, role definitions, or any other feature once the global constant is set to true, you can enable, configure, or disable it at the field level verify that the field is not referenced or updated in any way other than business rules setting a referenced or continuously updated field to "strict read only" will result in errors in workflows where it appears configuring strict read only for a field the global constant, when set to true , allows s to customize the way the read only business rule is applied to the field open the read only business rule in the read only rule editor , the box next to strict read only will be appear when the global constant is set to true by default, it is not checked if you want users to be able to modify the field using quick actions or other provided features, leave the strict read only box unchecked if you want to ensure that the field only updates via business rule, check the strict read only box the has two options to choose from to describe the condition of the field this field is always read only this option enforces update only by business rule ( strict read only ) this field is conditionally read only based on an expression this option ensures the field is only updated based on an expression when a field is designated as "strict read only," users attempting to modify the read only field receive an error message uncheck the strict read only box to remove server side validation from a field to disable the read only business rule for a field, check the disable rule box overriding the required business rule about required business rules docid\ dzatwdgrvzzx1my9orpd3setting a field in a business rule to required docid\ dzatwdgrvzzx1my9orpd3setting a form in a business rule to required docid\ dzatwdgrvzzx1my9orpd3overriding the required business rule for a form docid\ dzatwdgrvzzx1my9orpd3about completely overriding a required business rule docid\ dzatwdgrvzzx1my9orpd3required business rules matrix docid\ dzatwdgrvzzx1my9orpd3 about required business rules you can specify that a business rule be required for a field in this case, the application does not accept blank values in that field and you must enter something before the business rule can be saved the fields in business objects that are created as a result of this required business rule are also subject to these rules setting a field in a business rule to required to specify that a field in a business rule be required, do one of the following from the configuration console, click build > business objects to open the business objects workspace open a business object click the business rules tab scroll to the required rules section click the edit icon for a business rule do one of the following select this field is always required select this field is conditionally required based on an expression and set a condition for when this business rule is required if the condition evaluates to true , the field is required required field in a business rule click save setting a form in a business rule to required you can also specify that a business rule be required for all of the forms associated with a business object, including any that are created based on business rules or workflows from the configuration console, click build > business objects to open the business objects workspace open a business object click the business rules tab for the show rules for form field, select default required business rule overriding the required business rule for a form you can override a business rule from being required for all forms to make a business rule not required for a particular form, do the following from the configuration console, click build > business objects to open the business objects workspace open a business object click the business rules tab for the show rules for form field, select the form for which to override the rule the application only displays the business rules that affect this form check do not show any object wide rules, show only form specific ones click the required rules header to expand it open the business rule to modify select this field is conditionally required based on an expression and enter an expression click save by overriding a required business rule for a form, you are using the boolean or operator about completely overriding a required business rule by default, if you override a business rule on a form, it is combined with the business object level rule the resulting rule is of the form formrule or objectrule check complete override to ignore any previous business rules and only use this business rule the following are examples the problem business object has the following required rule for the owner field $(if status == "logged" || status == "cancelled" then false else true) to make the owner field not required when the status field is set to investigation and the form is the problem form, first override the default rule on the problem form $(if status == "investigation" then false else true) if left that way, the resulting expression for a form is $(if status == "logged" || status == "cancelled" then false else true) or $(if status == "investigation" then false else true) if the status field is set to investigation , the resulting value is still true (that is, the business rule is required) due to the first (business object level) clause there is no way to make the owner field not required for "identified" problem without having to change the business object level rule if you check complete override on a form business rule, the result is $(status == "investigation" then false else true) and it evaluates to false (that is, the business rule is not required) for business objects that have the status field set to investigation you must duplicate the business object level rule part within an overridden business rule to extend the behavior correctly to add the status field set to investigation to the list of not required and leave all other statuses as they are, check complete override and use this expression $(if status == "logged" || status == "cancelled" || status == "investigation" then false else true) required business rules matrix business object rule business object rule disabled? form rule form rule disabled? complete override? resulting business rule r f r or f r f true f r f true r r f true true r r true f f r true f f r true f true or true where r = business object level rule f = form level rule = false or not specified or true = the resulting value is the same for either true or false working with read only business rules about read only business rules docid\ dzatwdgrvzzx1my9orpd3specifying a read only rule for a field in a business object docid\ dzatwdgrvzzx1my9orpd3specifying a read only rule for a business object docid\ dzatwdgrvzzx1my9orpd3business objects containing final state rules docid\ dzatwdgrvzzx1my9orpd3 about read only business rules there are two types of read only rules that can be specified for a business object one is for fields within the business object and the other is for the business object the following information provides an examples of how to add a read only rule for both fields and business objects specifying a read only rule for a field in a business object from the configuration console, click build > business object to open the business object workspace open a business object click the business rules tab on the toolbar the business rules page appears under read only rules , click add read only rule the add read only rule window appears add read only rule window from the field name drop down list, select a field (for example, status valid ) check this field is conditionally read only based on expression in the expression editor, enter $(if(((status == "closed") then true else false))) add read only rule window with expression click save specifying a read only rule for a business object you can create a read only rule for a business object so that users are not allowed to modify the record after the status of the business object has been marked as being in a final state you can select the states that define a business object as final you can also specify more than one state, such as closed and canceled, as a final state do the following to edit a business object from the configuration console, click build > business object to open the business object workspace open a business object click the business rules tab on the toolbar to open the business rules page under read only rules , click add object read only rule to open the add final state rule window at the add final state rule window, add or edit the following field description name add an easily identifiable name for the rule such as final state rule for change description add a description for the business rule expression editor add the expression required to set the final state see the examples below for setting a single state or multiple states as final states to make closed a final state, enter $(status == "closed") to make closed, canceled, and denied final states, enter $(status == "closed" || status == "canceled" || status == "denied") except fields lists fields that can be edited even after the business object is in the final state enter exceptions here by selecting a field from the drop down list and clicking the add icon you can edit these fields for any business objects that contain final state designations disable rule disables the rule click save when you are done business objects containing final state rules the following business objects have read only rules specified, with at least one status defined as a final state once the status for the business object record is changed to that state, the record and any child records, such as tasks and approvals, that were assigned to a user, can no longer be edited business object final states approval canceled, approved, denied call log closed change closed, canceled, denied ci service retired knowledge expired incident closed problem canceled, closed project closed release canceled, closed service request canceled, closed overriding the triggered actions business rule for locked business object when a business object is locked, triggered actions for the business object cannot be modified if you click the on/off button for a triggered action record, the error message “ metadata permission for object instance prevents update ” is displayed however, there may be a case where you do not need all the default triggered actions provided for a business object and may want to disable some of them, in such a case you need to be able to override the business rule and disable certain triggered actions to do so, a global constant overwritetriggeractionspermissions is provided when the overwritetriggeractionspermissions is true you can edit the triggered actions for locked business objects when the overwritetriggeractionspermissions is false you cannot edit the triggered actions for locked business objects sample scenario edit triggered actions of a locked business object login to as an open the click build > business object open any locked business object and select the business rules tab try disable any of the triggered actions by clicking the on/off toggle button in the status column the application does not allow the edit and displays the message " metadata permission for object instance prevents update " add and enable the global constant add the global constant to be able to edit the triggered actions from the , click build > global constant click add in the global constant page enter the following values name overwritetriggeractionspermissions value true type boolean description enter a relevant description, example overwriting the triggered actions for locked business objects click save now edit triggered actions for a locked business object follow from step 1 docid\ dzatwdgrvzzx1my9orpd3 through step 5 you will be able to edit the triggered actions triggered actions edited for a locked business object
