Validation Error on Custom Entities in Sage CRM

By | May 29, 2020

Sage CRM gives us platform to add custom entities to enhanced business performance. While we were building custom entities screens we came across one error, which often found on any custom entity. As you know Sage CRM provides an advanced entity template which builds basic pages for custom entities. When validations are fired on these pages, screen goes into edit mode as expected but still shows “Change” and “Continue” buttons. To overcome this error refer below blog:
Writing validate scripts and handling ASP pages to fire validations

New Stuff: Set Communication status ‘Complete’ in Two click

Recently one of our client come across another issue related to validation message on custom entity i.e. whenever we fire a validation, error messages are shown twice on screen, refer below:

Duplicate Validation Message
Duplicate Validation Message

Below is the code snippet used to build this page:

Duplicate Validation Mes
Code Update

To overcome this error you will need to add below line of codes in your ASP Page:

Container=CRM.GetBlock("container");
Entry=CRM.GetBlock("SitesNewEntry");
Entry.Title="Sites";
Entry.CopyErrorsToPageErrorContent = true;
Entry.ShowValidationErrors = true;
Container.AddBlock(Entry);
Container.DisplayButton(1)=false;

CopyErrorsToPageErrorContent and ShowValidationErrors are the properties which handles error messages on screen, hence defining these properties are necessary. Now screen will show validation messages as expected, refer below:

Validation Message
Validation Message

You will need to add this code to new as well as summary page. Happy scripting!

About Us

Greytrix – a globally recognized and one of the oldest Sage Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation competence.

Greytrix helps in upgrading Sage ERP and CRM to the latest version and provides migration for Sage Intacct from Sage 300, Sage 100, Sage 50 and QuickBooks; for Sage 100, Sage 300 (Sage Accpac), Sage X3 from Sage Pro, Sage 50 US, Sage 50 CA, Sage 50 US, Sage Business Works, Sage Business Vision and QuickBooks; for Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer

For more information on Sage ERP – CRM migration solutions, please contact us at erpmig@greytrix.com. We will like to hear from you.