Showing information messages using Content block

By | May 14, 2012

We are very much familiar that Sage CRM provides very strong Themes based design using the eWare.css file. It has lots of pre-built CSS classes which are used by standard controls as well as they can be used by the custom controls we create. I am elaborating one such example in this blog. I came across the requirement where some information text was to be displayed to user along with continue button to navigate back. A quick idea that came into my mind was to use the Error content look for the same, however Red color for Information contents doesn’t look good hence decided to go with standard of Sage CRM to display the same in Blue color background. Refer the script used and Output below.
Script used
//’Get container block
Container=CRM.GetBlock(“container”);
//’Add message
ContentBlk = CRM.GetBlock(“Content”);
ContentBlk.Contents = “<Table width=’100%’><TR><TD>”;
ContentBlk.Contents += “You are not authorized to view the data.”
ContentBlk.Contents += “</TD></TR></Table>”
Container.AddBlock(ContentBlk);
//’Add continue button
Container.DisplayButton(Button_Continue) = true;
CRM.AddContent(Container.Execute());
Response.Write(CRM.GetPage(“New”));
Output