Mode

Sets a mode for the ASP page. This allows you to control what happens to certain blocks when they are executed.

Property values
  • 0. Sets the mode to View.
  • 1. Sets the mode to Edit.
  • 2. Sets the mode to Save.
  • 3. Sets the mode to PreDelete.
  • 4. Sets the mode to PostDelete.

Constants are declared for these values in the Sage CRM include files.

Examples

var Record = CRM.CreateRecord("Case");
var EntryGroup = CRM.GetBlock("CaseDetailBox");
if (CRM.Mode == 0){
CRM.Mode = 1;
}
CRM.AddContent(EntryGroup.Execute(Record));
Response.Write(CRM.GetPage());

If the CRM.Mode of the EntryGroup block is set to View (0), this example changes the mode to Edit (1) and displays the block in that mode.