There are many ways to skin a cat (yes, it is a cliche), and there are indeed many ways to make a field read-only in Siebel.
But you will have this burning question in mind – how about making child fields read-only depending on the parent business component fields?
Surprise, surprise – there are many ways to do that too. The common ways are outlined in the post referred above. The idea here is to drive the message through an example!
For the purposes of this post, let us consider an example. Our Siebel instance has Accounts, Contacts and Activities in the view. The objective is to make the Contacts and Activities read-only when Account is in ‘Terminated’ status.
1. BC Read Only Field
The most common way of turning the entire BC read-only is also the most common way to turn the child record read-only depending on the parent record.
Define the following user property –
Name: BC Read Only Field
Value: Read-only Account
Create the following calculated field in Contact.
Name: Read-only Account
Value: if (ParentFieldValue("Status") = "Terminated"), "Y", "N")
2. Parent Read Only Field
The next common occurrence in most Siebel implementations – Parent Read Only Field. The idea is to define the condition in child BC to make the record read-only depending the parent field value.
In our example, define the following user property in Contact business component.
Name: Parent Read Only Field
Value: Account.Status Read Only
Define the following field in Account business component.
Name: Status Read Only
Value: if ([Status] = LookupValue("ACCOUNT_STATUS") = 'Terminated', "Y", "N")
Link Specification: Y
3. Aspect User Property
You can use the highly versatile Aspect user properties to drive the read-only behaviour in child BCs.
You could define the user property on the parent to make the child BC read-only.
Name: Aspect Child BC ReadOnly: Contact
Value: Account Status Read-only
Or, you could define properties at the child BC level.
Name: Aspect BC Read Only
Value: Account Status Read-only
Aspect BC Read Only provides you the added bonus of disabling new/update buttons as well.
Refresh Issue: Child Record Not Read-only on Parent Field Change
So – you have defined the fields and user properties. And now, you will turn the status in Account to ‘Terminated’. But, you can see that with some properties described above, the child records do not become read-only immediately.
This is solved by –
- Using a property like RefreshBusComp for refreshing the current BC and also the child/parent records. This will retail the user context and current record.
- Use user property or script to leverage OOB services like ‘FINS Teller UI Navigation’ or ‘SIS OM PMT Service’ to refresh the view.123var psIn = TheApplication().NewPropertySet();var psOut = TheApplication().NewPropertySet();TheApplication().GetService("FINS Teller UI Navigation").InvokeMethod("RefreshCurrentApplet", psIn, psOut)
There is no preferred method per se. While any references to the parent field in the child BC will require ‘Link Specification’ to be turned to TRUE for parent fields, this is not required if you are controlling child BC behaviour at the parent level (e.g. Aspect Child BC ReadOnly user property).
Further Reference: Detailed documentation on how Siebel drives read-only behaviour