CreateScript

Specifies the server-side JavaScript to run upon the creation of the CRMGridColBlock instance.

Values
  • String. Specifies the JavaScript to run.

Example
Copy
CaseListBlock = CRM.GetBlock('CaseListBlock');
FoundIn = CaseListBlock.AddGridCol('pers_firstname');
FoundIn.AllowOrderBy = true;
FoundIn.OrderByDesc = true;
FoundIn.CreateScript = "if(CRM.GetContextInfo("company","comp_companyid")){Visible = false;}";
CRM.AddContent(CaseListBlock.Execute());
Response.Write(CRM.GetPage());

Adds a new column (pers_firstname) to the list. Sorts entries in the pers_firstname column in the descending order. Hides the Company name column if it is present in the context.