CopyErrorsToPageErrorContent
Specifies where to display validation errors related to a particular block on the page.
Values
This property can take one of the following values:
- true. Specifies to show validation errors at the top of the page.
- false. Specifies to show validation errors next to the related block on the page.
Examples
CompanyEntryGroup = CRM.GetBlock("CompanyBoxLong");
CompanyEntryGroup.Title = "Company";
AddressEntryGroup = CRM.GetBlock("AddressBoxLong");
AddressEntryGroup.Title = "Address";
// Set Valid = false so that this field will always fail validation no matter what is entered.
var address1field = AddressEntryGroup.GetEntry("addr_address1");
address1field.ValidateScript = "Valid = false; ErrorStr = 'Value not correct'";
// Set CopyErrorsToPageErrorContent = true for both of the blocks so that the error message
// will appear at the top of the page.
CompanyEntryGroup.CopyErrorsToPageErrorContent = true;
AddressEntryGroup.CopyErrorsToPageErrorContent = true;
container=CRM.GetBlock("container");
container.AddBlock(CompanyEntryGroup);
container.AddBlock(AddressEntryGroup);
Creates two entry blocks, one of which fails validation. The corresponding validation errors are displayed at the top of the page.