Lookup Table

Discussions related to custom development with Select.
Post Reply
dutil
Posts: 33
Joined: Thu Dec 19, 2019 12:10 pm

Lookup Table

Post by dutil »

Is there a way to reference a specific lookup table with a string?

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()));
But we are now trying reference a lookup table in another application (this is a separate maintenance/configuration style application and does not reference nor open any orders). This means we do not have a LoanPolicy object or a reference to the 'SoftPro.OrderTracking.Order' library that it appears to reside in.

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)?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Lookup Table

Post by BobRichards »

Have you reviewed the information on Lookup Tables in the SDK Help file?

The topics in the section "How-To / Lookup Tables" discuss how to work with lookup tables from a client connection - no open order required. It uses the same ILookups service you used.

If for some reason you don't have a copy of the SDK Help file, contact your SoftPro Customer Support Representative for a copy.
Bob Richards, Senior Software Developer, SoftPro
Post Reply