4 Replies Latest reply: Jan 31, 2012 8:14 AM by user99976 RSS

    Script for Making a Field ReadOnly

    SyedAsif
      In Oracle CRM ON DEMAND we have the “Status” dropdown field with value as “Completed” in Activities. I have Configure it in a such a way so that the Subject field becomes read only when the status is set to Completed.How to do that.
        • 1. Re: Script for Making a Field ReadOnly
          jiyong
          I have no experience with CRM on Demand, but in Siebel I would use a Business Component User Property "Field Read Only Field".
          Create a new calculated field that evaluates to Y when Status is Completed and use that calculated field with the User Property.
          • 2. Re: Script for Making a Field ReadOnly
            SyedAsif
            i have find the solution to this,
            to make the a field read only which is based on the value of the another picklist field, you can try the following code.

            PRE('<Subject>') = [<Subject>] OR NOT [<Status>]=LookupValue("EVENT_STATUS", "Completed")

            here if the value of the "Status" picklist is equals to "Completed" then the "Subject" Field becomes read only.

            Thank You
            • 3. Re: Script for Making a Field ReadOnly
              SyedAsif
              Thank You very Much for the much needed help.
              • 4. Re: Script for Making a Field ReadOnly
                user99976
                Subject is a Mandatory Field on the Activity Object, hence you can't make it read only inspite of using Dynamic Page Layouts. Only way you can do is, by use of Field Validations.

                You can define field validations on Subject or any other field. I prefer to choose a pick list field. Define the field validation on that pick list field following this logic.

                1. If the Status is not Completed, return the current value of the field
                2. If the Status is changed to Completed, return the current value of the field
                3. If the Status is not changed and the Subject is changed, return "Non Existing Pick list value" to the field

                By following the above logic, you can literally do anything. Hope this helps