Building a Search Select Advanced Field in ASP

Less than one minute read time.
I have covered the EntryTypes used in CRM in an earlier article, "Sage CRM EntryTypes used in the COM ASP API".

Below is a simple example showing how to create a Search Select Advanced in an ASP page.


var myBlock = CRM.GetBlock("opportunitydetailbox");
var personidBlock = CRM.GetBlock("entry");
with(personidBlock)
{
EntryType = 56;
LookUpFamily = 'Person'; //The search entity to be used
//DefaultType = 0; //no default search
//DefaultType = 16; //with current person
//DefaultType = 17; //with current company
//DefaultType = 19; //with custom entity
DefaultType = 20; //with current entity
SearchSQL = "pers_type='customer'";
Restrictor = "oppo_primarycompanyid";
Width = 30;
FieldName = "oppo_primarypersonid";
Caption = "Person:";
CaptionPos = CapTop;
NewLine = false;
}

//Add Entry Block
var myEntryBlock = myBlock.AddBlock(personidBlock);