Creating a Basic View Record Screen with the Web Class

Less than one minute read time.

Below is some example code that shows how to create a simple view screen with the Web class.


using Sage.CRM.Controls;
using Sage.CRM.Data;
using Sage.CRM.WebObject;

namespace SA_Basic_1
{
    class CompanyView : Web
    {
        public override void BuildContents()
        {
            GetTabs();
            AddContent(HTML.Form());
            EntryGroup myCompanyBoxShort = new EntryGroup("CompanyBoxShort");
            myCompanyBoxShort.Title = Metadata.GetTranslation("tabnames", "company");
            Record myCompany = FindCurrentRecord("company");
 
            AddContent(myCompanyBoxShort.GetHtmlInViewMode(myCompany));      
        }
    }
}

Notes:

  • The Notification is displayed because of the standard behaviour of the GetTabs() method.