SiebelGuide.com/siebelblogs

Siebel Blogs, News, Events, Tips and Tricks
Filed under How To, Tips&Tricks, eScript, All, Configuration

This is a very common requirement that Siebel Developer stumble upon. The requirement is to make the field read only based on the view so that the people who are assigned to this view using responsibilities are given read or write access.

Example Requirement: Make the field “Status” readonly for the view “Opportunity List Admin View” but all other views should have this field non-readonly.

Without wasting more time here are the steps to achieve this:

  1. In Siebel Tools select the Application in the object explorer.

  2. Select the Application you are using. For Example: Siebel Field Service
  3. Right Click and Edit Server Scripts
  4. Under Application_PreNavigate event set the profile attribute. Look at the code below. ActiveViewName is the profile attribute that is being set. The code will look something like this.

function Application_PreNavigate (DestViewName, DestBusObjName)
{
this.SetProfileAttr(”ActiveViewName”, DestViewName);
return (ContinueOperation);
}

Many people have an argument that it might not be a good idea to define it under the application and instead define this attribute under the View, but I think that it is better to have at the application level as I don’t have to define for multiple views and I can reference it from anywhere. Small scripts won’t affect anything.

  1. Create a calculated field under the BC.
    1. Field Name: CalcReadOnlyFlag
    2. Calculated Value: IIf (GetProfileAttr(”ActiveViewName”) = “Opportunity List Admin View”, “Y”,”N”) where “Opportunity List Admin View” is the name of the view for which you want to make readonly.
  2. Create a BC user property
    1. Name: Field Read Only Field: Status (Name of the field for which you want Read Only)
    2. Value: CalcReadOnlyFlag (This is the calculated field that you created above)

Compile and Test. It is as easy as mentioned above. Until my next post take care and have fun.

Related posts(Auto Generated):

  1. Count number of Child Records without Scripting
  2. How to Access Server Parameters using eScript
  3. eScripting Best Practices - Part1
  4. View not Visible in Siebel - Top 6 Reasons
  5. eScript Best Practices - Part7

Posted by Sridhar on Tuesday, August 5th, 2008


Page copy protected against web site content infringement by Copyscape
You can follow any responses to this entry through the magic of "RSS 2.0" and leave a trackback from your own site.

2 Responses to “How to make Field Read only Based on View?”

Post A Comment

Recent Posts 

Recent Comments:

  • Sridhar: LDAP mechanism should be handled by Siebel Server. So I dont know why this would matter. I havent tested with...
  • Nitin: Hi, Nice post, however i think this will not work in the case where we are using any aunthentication methods like...
  • Nitin: Hey, Its a nice post but this cannot work if you are using any authetication method like LDAP or something…or...
  • Sridhar: Check Siebel Book Shelf. Siebel Business Process FrameWork workflow guide->Invoking Workflow processes page...
  • Nitin Kumar Jain: Can I control whether the Workflow invoked by the RTE is Synchronous or Asynchronous call. If yes, how?...