namespace ECPDAL.Shared.QueryBuilders; /// /// Object-TYPE picker (not individual records) for the "link to a business object" step in the /// Task modal and Correspondence wizard — every active object type registered in MENTITY /// (Lead, Purchase Inquiry, Sales Order, Meeting, CollaborationSpace, ...). Columns confirmed /// from SqlWorkbench/SwDAL/Script/036_MENTITY_Framework_MinimalTable.sql's live-schema-derived /// DDL: ENTITYID, ENTITYCODE, ENTITYNAME, STATUS, MODULEID, SECTION. /// /// Scope note: this resolves WHICH TYPES of object can be linked to, not a specific record within /// a type (e.g. "Purchase Inquiry PI-330") — searching individual records requires querying each /// owning module's own table and is a separate, larger cross-module search design. /// public static class ObjectRegistryQB { public const string GET_SELECTLIST_OBJECT_TYPES = @" SELECT ENTITYID AS ObjectTypeId, ENTITYCODE AS ObjectTypeCode, ENTITYNAME AS ObjectTypeName, MODULEID AS ModuleId, SECTION AS Section FROM MENTITY WHERE STATUS = 1 AND (@SearchKeyword IS NULL OR ENTITYNAME LIKE '%' + @SearchKeyword + '%') ORDER BY ENTITYNAME ASC"; }