Building a Screen not bound to Meta Data using the ASP COM API

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Building a Screen not bound to Meta Data using the ASP COM API

  • Comments 2
  • Likes
Partial Rebuild of My Preferences Screen
The code below demonstrates how a page like the Preferences screen can be rebuilt in Sage CRM. This particular screen may be needed to be replaced if the business wishes to offer users only a limited set of preferences that maybe controlled. In the default system the system administrator can either let the user control all their preferences or non of them.

You can learn more about building screens without reference to meta data here:

var intRecordId = CRM.GetContextInfo("user","user_userid");
var myRecord = CRM.FindRecord("usersettings","uset_key='NSet_LoginTo' and uset_userid="+intRecordId);
var myBlock = CRM.GetBlock("entrygroup");
myBlock.Title = CRM.GetTrans("Tabnames","UserPrefsSession");

var customSelectionEntryBlock = CRM.GetBlock("entry");
DefaultValue = myRecord.uset_value;
EntryType = 21;
AllowBlank = false;

if (CRM.Mode==View)
Caption = CRM.GetTrans("ColNames","NSet_LoginTo")+":</SPAN><BR><SPAN class='VIEWBOX'>;"+CRM.GetTrans("DefaultToDo",myRecord.uset_value)+"</span>";
Caption = CRM.GetTrans("ColNames","NSet_LoginTo")+":";

CaptionPos = CapTop;
FieldName = "Set_LoginTo";
LookUpFamily = "DefaultToDo"
Size = 1;
NewLine = false;



//Retrieve Record
myRecord.uset_value = Request.Form("Set_LoginTo");

The main thing to point out here is the creation of the field when the screen is in VIEW mode.
  • Hi Jeff,

    Is it possible to create a screen that does not reference metedata similar to the above code via the .Net API?

    I have been playing around with the Entry class but that appears to only be for accessing fields on existing screen as when I try to set the EntryType property I get an error saying it is Read Only.

    Entry myEntry = new Entry("comp_test");

    myEntry.EntryType = Sage.EntryTypes.Text; --------> this gives a Read Only error.

    I've done a bit of digging in the developer help and the documentation that comes with the SDK but I can't seem to find what I am looking for.

    Any and all help greatly appreciated!!


  • Mike

    You are spot on.  The property EntryType is readonly.  The .NET SDK assumes that you are working with system screens.  The EntryGroup() class also assumes you are working with existing metadata screens.

    Have a look at the classes in Sage.CRM.HTML namespace.  These allow you to create forms and inputs within a .NET screen.