June 24, 2013

How to make field conditionally editable in Siebel?

Requirement: To make Siebel Fields editable only from certain views or certain users?

This sort of customization could come up when business would like to update fields from certain views only and make then read only from elsewhere.

Solution: This requirement can be achieved in many ways, listing script-less solutions here:

1. Clone the Applet and views and make the control read only by setting the read only flag on Applet

Benefits: As the solution makes copy of UI layer, it does not impact the business layer. If there is any script which is updating the field as part of another process it wont require any changes as field on the BC remains unchanged.
Drawbacks: Duplicate objects make application complex and difficult to manage.

2. Create Field Read Only Field user property to make the read only if the active view name is not same as the intended view.
This can be done by using : GetProfileAttr('ActiveViewName').
Benefits: No new object created thus keep the keep maintenance simple and keep the business logic at one location.

3. Use GetProfileAttrAsList in calculated field to check the responsibility of user.
If user has the responsibility then field will be editable and for all other users field will be read only. This responsibility can be added to SADMIN as well so that background workflows can only update this field.

syntax of calculated field:
IIf(InList(“EditableField”,GetProfileAttrAsList(“User Responsibilities”)))
If you have come across any other  scenario in which you were forced to write script then please share it with us in comments below.

1 comment :

  1. Even when the view is readonly for a particular responsibity, the buttons are editable. How can I do it using configuration? I am able to achieve it through script.

    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
    if(MethodName == "NewRecord")
    var t = TheApplication().InvokeMethod("IsViewReadOnly", TheApplication().ActiveViewName());
    if(t == "FALSE") //meaning the view is NOT read only
    CanInvoke = "TRUE";
    CanInvoke = "FALSE";
    } return (ContinueOperation);