The previous way we would access a lookup table (ex: below) requires passing in a type for the context, this requires a reference to the 'Softpro.OrderTracking.Order' assembly, which is only made available when you open an order and not an assembly we can access directly.
Code: Select all
var lookupService = SelectServer.GetService<ILookups>();
ILookupMap map = lookupService.GetLookupMap(Order.OwnershipProfile);
ILookupMapEntry entry = null;
if (!map.TryGet(LoanPolicy.GetType(), ".InsuredMortgageLookupCode", out entry))
{
InsuredMortgage_radDropDownList.Enabled = false;
return;
}
var spec = new LookupQuerySpec
{
SchemaOnly = false,
Table = entry.Name
};
var table = lookupService.QueryTable(spec);
var rows = new List<string> { string.Empty };
rows.AddRange(table.Rows.Select(x => x[0].Value.ToString()));
Is there another way to query the lookup tables (via string preferably) or a way to get a direct reference to 'SoftPro.OrderTracking.Order' so we can reference the types in it for the 'ILookupMap.TryGet()' call (without requiring opening an order to trigger the assembly load from the service)?