BC USER PROPERTIES (READ ONLY BEHAVIOUR)
Configuring Data-Driven Read-Only Behavior
---------------------------------------------------------
Business components and fields can be configured as dynamically accessible, with their read-only status turned on and off depending on the value in a particular field in the current record. This is accomplished using one of the following Business Component object type user properties, depending on the requirement:
BC Read Only Field :
Specifies a TRUE or FALSE field in the record that, when TRUE, causes the current record to become read-only.
Field Read Only Field: fieldname
Specifies a TRUE or FALSE test field and a target field in the same business component. When the TRUE/FALSE field is true, the target field becomes read-only.
NOTE: Fieldname syntax works if Fieldname is not a join field. If Fieldname is a join field to another table, then this syntax does not prepopulate the field that uses this syntax in its Pre Default Value.
Parent Read Only Field
Specifies a TRUE or FALSE test business component or field combination in the parent chain (parent, grandparent, and so on) that, when TRUE, causes the target business component to become read-only.
For more information about user properties, see Siebel Developer's Reference.
When configuring read-only behavior, consider the following:
Wherever a business component or field name is specified, whether in the Name or Value property of the user property object definition, make sure that the capitalization, spelling, and use of blank spaces are correct. Also make sure that quotation marks are not present.
These user properties do not function when used in an applet in a view where the view's Admin Mode property is set to TRUE.
Admin Mode, when TRUE, turns off all insert and update restrictions for the business components used by the view, including those specified by business component user properties. The business component Sales Rep and Personal visibility modes are ignored. Records that do not have a primary team member are also visible. However, pop-up visibility is not overridden.
NOTE: The Admin Mode flag should be set to TRUE only in a view that is part of a screen containing all administration views. Do not use the Admin Mode flag for a view in a screen that contains any non-administration views.
You can have a list view with Admin Mode set to TRUE that drills down to a detail view not marked as an administration view, while remaining in Admin Mode. This allows you to share detail views with non-administration list views.
BC Read-Only Field:
This user property specifies a Boolean field that, when TRUE, causes all fields in the current record to become read-only. This also prevents the user from updating or deleting the record, but does not prevent the addition of new records to the business component. The Name and Value properties in the user property record are specified as follows:
Name: Contains the literal text BC Read Only Field.
Value: Contains the name of a field in the same business component as the parent object definition of the user property. This field must be a TRUE or FALSE field.
An example of the use of BC Read Only Field is the situation in which you need to prevent users from updating inactive accounts. The Inactive Account field in an account record is a TRUE or FALSE field that, when TRUE, indicates that the account is inactive. To configure dynamic read-only behavior for the Account business component based on this field, add a business component user property child object definition to the Account business component, with the following property settings:
Value :Inactive Account.
Field Read Only Field
This user property is similar to BC Read Only Field, in that it tests the field specified in the Value property and enforces a read-only restriction when the test field has a value of TRUE in the current record. However, unlike BC Read Only Field, the Field Read Only Field user property restricts one field in the same business component, rather than the entire business component record.
The Name and Value properties in the user property record are specified as follows:
Name. Contains an expression in the following format:
Field Read Only Field: fieldname
For example:
One Field Read Only Field user property must be created for each field you want to make conditionally read-only.
Create a calculated Boolean field in this business component that will have a value of TRUE when the Type field has a value of Competitor.
For purposes of the example, the name of this test field can be Competitor Calc, although the name is unimportant as long as it is referenced correctly in the user property.
IIf([Type] = "Competitor", "Y", "N")
Set the following values in the new Business Component User Prop object definition:
Name. Field Read Only Field: Competitor
Value. Competitor Calc
Parent Read Only Field
This property, like BC Read Only Field, places a read-only restriction on an entire business component, rather than a single target field. This restriction occurs when a TRUE or FALSE test field has a TRUE value. However, unlike BC Read Only Field and Field Read Only Field, this user property is used to place a restriction on a child or grandchild (and so on) business component of the business component containing the test field. In the other user properties, the read-only restriction is placed on the business component containing the test field, or on another field in the same business component.
Parent Read Only Field is used primarily to restrict the detail records in a multi-value group. It could also be used to restrict the detail records in a master-detail view, but in that case you need to make sure that the restricted business component is not also used in the context of some other business object than the intended one.
The Name and Value properties in the user property record are specified as follows:
Name. Contains the literal text Parent Read-Only Field.
Value. Contains an expression in the following format:
buscompname.fieldname
An example of the use of this user property is the situation where you want to disable the update of the Account Address multi-value group when the account record has a Type of Competitor. To accomplish this, you add the same calculated field as in the Field Read Only Field example, and then add a user property to the Business Address business component with the following values:
Name. Parent Read Only Field
Value. Account.Competitor Calc
This causes the Account Address multi-value group to be read-only when the account record is for a competitor.
No comments:
Post a Comment