Adding a Create script to a list or grid

This example adds a Create Script to the Opportunity List, which hides the Company Name column if the company context is present.

  1. Click <My Profile> | Administration | Customization | Primary Entities | Opportunity | Lists.
  2. Click the Opportunity List hypertext link.
  3. Click the column that you want to attach the Create Script to, in this example Company: Company Name.
  4. Add the following Create Script to Create Script and click Update.
    Copy
    if(CRM.GetContextInfo("company","comp_name"))
        {
            Visible = false;
        }
  5. Click the Opportunities tab in the context of a company. The Company Name column is no longer visible.
  6. Click My CRM | Opportunities. The Company Name column is still visible.